Move all internal header files to a separate directory, so that it's clear what
authorewan@localhost.localdomain <ewan@localhost.localdomain>
Sat, 21 Apr 2007 19:21:06 +0000 (12:21 -0700)
committerewan@localhost.localdomain <ewan@localhost.localdomain>
Sat, 21 Apr 2007 19:21:06 +0000 (12:21 -0700)
forms the public API.  Tidy up a couple of macros in xen_internal.h.  Remove
test_hvm_bindings, which no longer builds, and which has had its functionality
subsumed into test_bindings.  Bump the library version to 0.9.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
159 files changed:
tools/libxen/Makefile
tools/libxen/include/xen/api/xen_all.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_common.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_console.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_console_decl.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_console_protocol.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_crashdump.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_crashdump_decl.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_event.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_event_decl.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_event_operation.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_host.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_host_cpu.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_host_cpu_decl.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_host_decl.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_host_metrics.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_host_metrics_decl.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_int_float_map.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_int_int_map.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_int_string_set_map.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_network.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_network_decl.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_on_crash_behaviour.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_on_normal_exit.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_pbd.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_pbd_decl.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_pif.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_pif_decl.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_pif_metrics.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_pif_metrics_decl.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_sr.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_sr_decl.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_string_set.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_string_string_map.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_user.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_user_decl.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_vbd.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_vbd_decl.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_vbd_metrics.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_vbd_metrics_decl.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_vbd_mode.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_vbd_type.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_vdi.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_vdi_decl.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_vdi_type.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_vif.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_vif_decl.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_vif_metrics.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_vif_metrics_decl.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_vm.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_vm_decl.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_vm_guest_metrics.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_vm_guest_metrics_decl.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_vm_metrics.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_vm_metrics_decl.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_vm_power_state.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_vtpm.h [new file with mode: 0644]
tools/libxen/include/xen/api/xen_vtpm_decl.h [new file with mode: 0644]
tools/libxen/include/xen_common.h [deleted file]
tools/libxen/include/xen_console.h [deleted file]
tools/libxen/include/xen_console_decl.h [deleted file]
tools/libxen/include/xen_console_protocol.h [deleted file]
tools/libxen/include/xen_console_protocol_internal.h
tools/libxen/include/xen_crashdump.h [deleted file]
tools/libxen/include/xen_crashdump_decl.h [deleted file]
tools/libxen/include/xen_event.h [deleted file]
tools/libxen/include/xen_event_decl.h [deleted file]
tools/libxen/include/xen_event_operation.h [deleted file]
tools/libxen/include/xen_host.h [deleted file]
tools/libxen/include/xen_host_cpu.h [deleted file]
tools/libxen/include/xen_host_cpu_decl.h [deleted file]
tools/libxen/include/xen_host_decl.h [deleted file]
tools/libxen/include/xen_host_metrics.h [deleted file]
tools/libxen/include/xen_host_metrics_decl.h [deleted file]
tools/libxen/include/xen_int_float_map.h [deleted file]
tools/libxen/include/xen_int_int_map.h [deleted file]
tools/libxen/include/xen_int_string_set_map.h [deleted file]
tools/libxen/include/xen_internal.h
tools/libxen/include/xen_network.h [deleted file]
tools/libxen/include/xen_network_decl.h [deleted file]
tools/libxen/include/xen_on_crash_behaviour.h [deleted file]
tools/libxen/include/xen_on_crash_behaviour_internal.h
tools/libxen/include/xen_on_normal_exit.h [deleted file]
tools/libxen/include/xen_on_normal_exit_internal.h
tools/libxen/include/xen_pbd.h [deleted file]
tools/libxen/include/xen_pbd_decl.h [deleted file]
tools/libxen/include/xen_pif.h [deleted file]
tools/libxen/include/xen_pif_decl.h [deleted file]
tools/libxen/include/xen_pif_metrics.h [deleted file]
tools/libxen/include/xen_pif_metrics_decl.h [deleted file]
tools/libxen/include/xen_sr.h [deleted file]
tools/libxen/include/xen_sr_decl.h [deleted file]
tools/libxen/include/xen_string_set.h [deleted file]
tools/libxen/include/xen_string_string_map.h [deleted file]
tools/libxen/include/xen_user.h [deleted file]
tools/libxen/include/xen_user_decl.h [deleted file]
tools/libxen/include/xen_vbd.h [deleted file]
tools/libxen/include/xen_vbd_decl.h [deleted file]
tools/libxen/include/xen_vbd_metrics.h [deleted file]
tools/libxen/include/xen_vbd_metrics_decl.h [deleted file]
tools/libxen/include/xen_vbd_mode.h [deleted file]
tools/libxen/include/xen_vbd_mode_internal.h
tools/libxen/include/xen_vbd_type.h [deleted file]
tools/libxen/include/xen_vdi.h [deleted file]
tools/libxen/include/xen_vdi_decl.h [deleted file]
tools/libxen/include/xen_vdi_type.h [deleted file]
tools/libxen/include/xen_vdi_type_internal.h
tools/libxen/include/xen_vif.h [deleted file]
tools/libxen/include/xen_vif_decl.h [deleted file]
tools/libxen/include/xen_vif_metrics.h [deleted file]
tools/libxen/include/xen_vif_metrics_decl.h [deleted file]
tools/libxen/include/xen_vm.h [deleted file]
tools/libxen/include/xen_vm_decl.h [deleted file]
tools/libxen/include/xen_vm_guest_metrics.h [deleted file]
tools/libxen/include/xen_vm_guest_metrics_decl.h [deleted file]
tools/libxen/include/xen_vm_metrics.h [deleted file]
tools/libxen/include/xen_vm_metrics_decl.h [deleted file]
tools/libxen/include/xen_vm_power_state.h [deleted file]
tools/libxen/include/xen_vm_power_state_internal.h
tools/libxen/include/xen_vtpm.h [deleted file]
tools/libxen/include/xen_vtpm_decl.h [deleted file]
tools/libxen/src/xen_common.c
tools/libxen/src/xen_console.c
tools/libxen/src/xen_console_protocol.c
tools/libxen/src/xen_crashdump.c
tools/libxen/src/xen_event.c
tools/libxen/src/xen_event_operation.c
tools/libxen/src/xen_host.c
tools/libxen/src/xen_host_cpu.c
tools/libxen/src/xen_host_metrics.c
tools/libxen/src/xen_int_float_map.c
tools/libxen/src/xen_int_int_map.c
tools/libxen/src/xen_int_string_set_map.c
tools/libxen/src/xen_network.c
tools/libxen/src/xen_on_crash_behaviour.c
tools/libxen/src/xen_on_normal_exit.c
tools/libxen/src/xen_pbd.c
tools/libxen/src/xen_pif.c
tools/libxen/src/xen_pif_metrics.c
tools/libxen/src/xen_sr.c
tools/libxen/src/xen_string_set.c
tools/libxen/src/xen_string_string_map.c
tools/libxen/src/xen_user.c
tools/libxen/src/xen_vbd.c
tools/libxen/src/xen_vbd_metrics.c
tools/libxen/src/xen_vbd_mode.c
tools/libxen/src/xen_vbd_type.c
tools/libxen/src/xen_vdi.c
tools/libxen/src/xen_vdi_type.c
tools/libxen/src/xen_vif.c
tools/libxen/src/xen_vif_metrics.c
tools/libxen/src/xen_vm.c
tools/libxen/src/xen_vm_guest_metrics.c
tools/libxen/src/xen_vm_metrics.c
tools/libxen/src/xen_vm_power_state.c
tools/libxen/src/xen_vtpm.c
tools/libxen/test/test_bindings.c
tools/libxen/test/test_event_handling.c
tools/libxen/test/test_hvm_bindings.c [deleted file]

index 51062d7c5b2a4ab0bab235a65e6cbf4893aa30e1..d91be3c33dfbffcf253665d94c61456dc07b5569 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2006, XenSource Inc.
+# Copyright (c) 2006-2007, XenSource Inc.
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 XEN_ROOT=../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-MAJOR = 0.1
-MINOR = 0
+MAJOR = 0.9
+MINOR = 1
 
 CFLAGS = -Iinclude                     \
-        $(shell xml2-config --cflags) \
+         $(shell xml2-config --cflags) \
          $(shell curl-config --cflags) \
          -W -Wall -Wmissing-prototypes -Werror -std=c99 -O2 -fPIC
 
 LDFLAGS = $(shell xml2-config --libs) \
           $(shell curl-config --libs)
 
-LIBXENAPI_HDRS = $(wildcard include/*.h)
+LIBXENAPI_HDRS = $(wildcard include/xen/api/*.h) include/xen/api/xen_all.h
 LIBXENAPI_OBJS = $(patsubst %.c, %.o, $(wildcard src/*.c))
 
+TEST_PROGRAMS = test/test_bindings test/test_event_handling
 
 .PHONY: all
 all: libxenapi.so libxenapi.a
@@ -48,13 +49,7 @@ libxenapi.so.$(MAJOR).$(MINOR): $(LIBXENAPI_OBJS)
 libxenapi.a: $(LIBXENAPI_OBJS)
        $(AR) rcs libxenapi.a $^
 
-test/test_bindings: test/test_bindings.o libxenapi.so
-       $(CC) $(LDFLAGS) -o $@ $< -L . -lxenapi
-
-test/test_event_handling: test/test_event_handling.o libxenapi.so
-       $(CC) $(LDFLAGS) -o $@ $< -L . -lxenapi
-
-test/test_hvm_bindings: test/test_hvm_bindings.o libxenapi.so
+$(TEST_PROGRAMS): test/%: test/%.o libxenapi.so
        $(CC) $(LDFLAGS) -o $@ $< -L . -lxenapi
 
 
@@ -70,9 +65,21 @@ install: all
            $(INSTALL_DATA) $$i $(DESTDIR)/usr/include/xen/api; \
        done
 
+
 .PHONY: clean
 clean:
        rm -f `find -name *.o`
        rm -f libxenapi.so*
        rm -f libxenapi.a
-       rm -f test/test_bindings
+       rm -f $(TEST_PROGRAMS)
+
+
+.PHONY: uberheader
+uberheader: include/xen/api/xen_all.h
+include/xen/api/xen_all.h::
+       echo "/* This file is autogenerated */" >$@
+       echo "#ifndef XEN_API_XEN_ALL_H" >>$@
+       echo "#define XEN_API_XEN_ALL_H" >>$@
+       ls include/xen/api/*.h | grep -v xen_all.h | grep -v _decl.h | \
+          sed 's,^include/\(.*\)$$,#include <\1>,g' >>$@
+       echo "#endif" >>$@
diff --git a/tools/libxen/include/xen/api/xen_all.h b/tools/libxen/include/xen/api/xen_all.h
new file mode 100644 (file)
index 0000000..8f0c1b8
--- /dev/null
@@ -0,0 +1,39 @@
+/* This file is autogenerated */
+#ifndef XEN_API_XEN_ALL_H
+#define XEN_API_XEN_ALL_H
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_console.h>
+#include <xen/api/xen_console_protocol.h>
+#include <xen/api/xen_crashdump.h>
+#include <xen/api/xen_event.h>
+#include <xen/api/xen_event_operation.h>
+#include <xen/api/xen_host_cpu.h>
+#include <xen/api/xen_host.h>
+#include <xen/api/xen_host_metrics.h>
+#include <xen/api/xen_int_float_map.h>
+#include <xen/api/xen_int_int_map.h>
+#include <xen/api/xen_int_string_set_map.h>
+#include <xen/api/xen_network.h>
+#include <xen/api/xen_on_crash_behaviour.h>
+#include <xen/api/xen_on_normal_exit.h>
+#include <xen/api/xen_pbd.h>
+#include <xen/api/xen_pif.h>
+#include <xen/api/xen_pif_metrics.h>
+#include <xen/api/xen_sr.h>
+#include <xen/api/xen_string_set.h>
+#include <xen/api/xen_string_string_map.h>
+#include <xen/api/xen_user.h>
+#include <xen/api/xen_vbd.h>
+#include <xen/api/xen_vbd_metrics.h>
+#include <xen/api/xen_vbd_mode.h>
+#include <xen/api/xen_vbd_type.h>
+#include <xen/api/xen_vdi.h>
+#include <xen/api/xen_vdi_type.h>
+#include <xen/api/xen_vif.h>
+#include <xen/api/xen_vif_metrics.h>
+#include <xen/api/xen_vm_guest_metrics.h>
+#include <xen/api/xen_vm.h>
+#include <xen/api/xen_vm_metrics.h>
+#include <xen/api/xen_vm_power_state.h>
+#include <xen/api/xen_vtpm.h>
+#endif
diff --git a/tools/libxen/include/xen/api/xen_common.h b/tools/libxen/include/xen/api/xen_common.h
new file mode 100644 (file)
index 0000000..89d92ca
--- /dev/null
@@ -0,0 +1,211 @@
+/*
+ * Copyright (c) 2006 XenSource, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_COMMON_H
+#define XEN_COMMON_H
+
+
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <time.h>
+
+#include "xen/api/xen_host_decl.h"
+
+
+typedef bool (*xen_result_func)(const void *data, size_t len,
+                                void *result_handle);
+
+
+/**
+ * len does not include a terminating \0.
+ */
+typedef int (*xen_call_func)(const void *, size_t len, void *user_handle,
+                             void *result_handle,
+                             xen_result_func result_func);
+
+
+typedef struct
+{
+    xen_call_func call_func;
+    void *handle;
+    const char *session_id;
+    bool ok;
+    char **error_description;
+    int error_description_count;
+} xen_session;
+
+
+typedef struct xen_session_record
+{
+    char *uuid;
+    struct xen_host_record_opt *this_host;
+    char *this_user;
+    time_t last_active;
+} xen_session_record;
+
+
+/**
+ * Allocate a xen_session_record.
+ */
+extern xen_session_record *
+xen_session_record_alloc(void);
+
+
+/**
+ * Free the given xen_session_record, and all referenced values.  The
+ * given record must have been allocated by this library.
+ */
+extern void
+xen_session_record_free(xen_session_record *record);
+
+
+struct xen_task_;
+typedef struct xen_task_ * xen_task_id;
+
+
+typedef struct
+{
+    int progress;
+    long eta;
+    /* !!! RESULT */
+}  xen_task_status;
+
+
+typedef struct
+{
+    int major;
+    int minor;
+    int patch;
+    char *extraversion;
+} xen_version;
+
+
+/**
+ * Free the given xen_version, and all referenced values.
+ */
+extern void xen_version_free(xen_version *version);
+
+
+/**
+ * Return the version of this client-side library.  This will be the major,
+ * minor, and extraversion of the Xen release with which it was released,
+ * plus the library's own version as the patch.
+ */
+extern xen_version *xen_get_client_side_version();
+
+
+extern bool
+xen_uuid_string_to_bytes(char *uuid, char **bytes);
+
+
+extern bool
+xen_uuid_bytes_to_string(char *bytes, char **uuid);
+
+
+extern void
+xen_uuid_free(char *uuid);
+
+
+extern void
+xen_uuid_bytes_free(char *bytes);
+
+
+/**
+ * Initialise this library.  Call this before starting to use this library.
+ * Note that since this library depends upon libxml2, you should also call
+ * xmlInitParser as appropriate for your program.
+ */
+extern
+void xen_init(void);
+
+
+/**
+ * Clear up this library.  Call when you have finished using this library.
+ * Note that since this library depends upon libxml2, you should also call
+ * xmlCleanupParser as appropriate for your program.
+ */
+extern
+void xen_fini(void);
+
+
+/**
+ * Log in at the server, and allocate a xen_session to represent this session.
+ */
+extern xen_session *
+xen_session_login_with_password(xen_call_func call_func, void *handle,
+                                const char *uname, const char *pwd);
+
+
+/**
+ * Log out at the server, and free the xen_session.
+ */
+extern void
+xen_session_logout(xen_session *session);
+
+
+/**
+ * Clear any error condition recorded on this session.
+ */
+void
+xen_session_clear_error(xen_session *session);
+
+
+/**
+ * Get the UUID of the second given session.  Set *result to point at a
+ * string, yours to free.
+ */
+extern bool
+xen_session_get_uuid(xen_session *session, char **result,
+                     xen_session *self_session);
+
+
+/**
+ * Get the this_host field of the second given session.  Set *result to be a
+ * handle to that host.
+ */
+extern bool
+xen_session_get_this_host(xen_session *session, xen_host *result,
+                          xen_session *self_session);
+
+
+/**
+ * Get the this_user field of the second given session.  Set *result to point
+ * at a string, yours to free.
+ */
+extern bool
+xen_session_get_this_user(xen_session *session, char **result,
+                          xen_session *self_session);
+
+
+/**
+ * Get the last_active field of the given session, and place it in *result.
+ */
+extern bool
+xen_session_get_last_active(xen_session *session, time_t *result,
+                            xen_session *self_session);
+
+/**
+ * Get a record containing the current state of the second given session.
+ */
+extern bool
+xen_session_get_record(xen_session *session, xen_session_record **result,
+                       xen_session *self_session);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_console.h b/tools/libxen/include/xen/api/xen_console.h
new file mode 100644 (file)
index 0000000..19bfdeb
--- /dev/null
@@ -0,0 +1,247 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_CONSOLE_H
+#define XEN_CONSOLE_H
+
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_console_decl.h>
+#include <xen/api/xen_console_protocol.h>
+#include <xen/api/xen_string_string_map.h>
+#include <xen/api/xen_vm_decl.h>
+
+
+/*
+ * The console class.
+ * 
+ * A console.
+ */
+
+
+/**
+ * Free the given xen_console.  The given handle must have been
+ * allocated by this library.
+ */
+extern void
+xen_console_free(xen_console console);
+
+
+typedef struct xen_console_set
+{
+    size_t size;
+    xen_console *contents[];
+} xen_console_set;
+
+/**
+ * Allocate a xen_console_set of the given size.
+ */
+extern xen_console_set *
+xen_console_set_alloc(size_t size);
+
+/**
+ * Free the given xen_console_set.  The given set must have been
+ * allocated by this library.
+ */
+extern void
+xen_console_set_free(xen_console_set *set);
+
+
+typedef struct xen_console_record
+{
+    xen_console handle;
+    char *uuid;
+    enum xen_console_protocol protocol;
+    char *location;
+    struct xen_vm_record_opt *vm;
+    xen_string_string_map *other_config;
+} xen_console_record;
+
+/**
+ * Allocate a xen_console_record.
+ */
+extern xen_console_record *
+xen_console_record_alloc(void);
+
+/**
+ * Free the given xen_console_record, and all referenced values.  The
+ * given record must have been allocated by this library.
+ */
+extern void
+xen_console_record_free(xen_console_record *record);
+
+
+typedef struct xen_console_record_opt
+{
+    bool is_record;
+    union
+    {
+        xen_console handle;
+        xen_console_record *record;
+    } u;
+} xen_console_record_opt;
+
+/**
+ * Allocate a xen_console_record_opt.
+ */
+extern xen_console_record_opt *
+xen_console_record_opt_alloc(void);
+
+/**
+ * Free the given xen_console_record_opt, and all referenced values. 
+ * The given record_opt must have been allocated by this library.
+ */
+extern void
+xen_console_record_opt_free(xen_console_record_opt *record_opt);
+
+
+typedef struct xen_console_record_set
+{
+    size_t size;
+    xen_console_record *contents[];
+} xen_console_record_set;
+
+/**
+ * Allocate a xen_console_record_set of the given size.
+ */
+extern xen_console_record_set *
+xen_console_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_console_record_set, and all referenced values. 
+ * The given set must have been allocated by this library.
+ */
+extern void
+xen_console_record_set_free(xen_console_record_set *set);
+
+
+
+typedef struct xen_console_record_opt_set
+{
+    size_t size;
+    xen_console_record_opt *contents[];
+} xen_console_record_opt_set;
+
+/**
+ * Allocate a xen_console_record_opt_set of the given size.
+ */
+extern xen_console_record_opt_set *
+xen_console_record_opt_set_alloc(size_t size);
+
+/**
+ * Free the given xen_console_record_opt_set, and all referenced
+ * values.  The given set must have been allocated by this library.
+ */
+extern void
+xen_console_record_opt_set_free(xen_console_record_opt_set *set);
+
+
+/**
+ * Get a record containing the current state of the given console.
+ */
+extern bool
+xen_console_get_record(xen_session *session, xen_console_record **result, xen_console console);
+
+
+/**
+ * Get a reference to the console instance with the specified UUID.
+ */
+extern bool
+xen_console_get_by_uuid(xen_session *session, xen_console *result, char *uuid);
+
+
+/**
+ * Create a new console instance, and return its handle.
+ */
+extern bool
+xen_console_create(xen_session *session, xen_console *result, xen_console_record *record);
+
+
+/**
+ * Destroy the specified console instance.
+ */
+extern bool
+xen_console_destroy(xen_session *session, xen_console console);
+
+
+/**
+ * Get the uuid field of the given console.
+ */
+extern bool
+xen_console_get_uuid(xen_session *session, char **result, xen_console console);
+
+
+/**
+ * Get the protocol field of the given console.
+ */
+extern bool
+xen_console_get_protocol(xen_session *session, enum xen_console_protocol *result, xen_console console);
+
+
+/**
+ * Get the location field of the given console.
+ */
+extern bool
+xen_console_get_location(xen_session *session, char **result, xen_console console);
+
+
+/**
+ * Get the VM field of the given console.
+ */
+extern bool
+xen_console_get_vm(xen_session *session, xen_vm *result, xen_console console);
+
+
+/**
+ * Get the other_config field of the given console.
+ */
+extern bool
+xen_console_get_other_config(xen_session *session, xen_string_string_map **result, xen_console console);
+
+
+/**
+ * Set the other_config field of the given console.
+ */
+extern bool
+xen_console_set_other_config(xen_session *session, xen_console console, xen_string_string_map *other_config);
+
+
+/**
+ * Add the given key-value pair to the other_config field of the given
+ * console.
+ */
+extern bool
+xen_console_add_to_other_config(xen_session *session, xen_console console, char *key, char *value);
+
+
+/**
+ * Remove the given key and its corresponding value from the
+ * other_config field of the given console.  If the key is not in that Map,
+ * then do nothing.
+ */
+extern bool
+xen_console_remove_from_other_config(xen_session *session, xen_console console, char *key);
+
+
+/**
+ * Return a list of all the consoles known to the system.
+ */
+extern bool
+xen_console_get_all(xen_session *session, struct xen_console_set **result);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_console_decl.h b/tools/libxen/include/xen/api/xen_console_decl.h
new file mode 100644 (file)
index 0000000..432ff76
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_CONSOLE_DECL_H
+#define XEN_CONSOLE_DECL_H
+
+typedef void *xen_console;
+
+struct xen_console_set;
+struct xen_console_record;
+struct xen_console_record_set;
+struct xen_console_record_opt;
+struct xen_console_record_opt_set;
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_console_protocol.h b/tools/libxen/include/xen/api/xen_console_protocol.h
new file mode 100644 (file)
index 0000000..413ad7a
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_CONSOLE_PROTOCOL_H
+#define XEN_CONSOLE_PROTOCOL_H
+
+
+#include <xen/api/xen_common.h>
+
+
+enum xen_console_protocol
+{
+    /**
+     * VT100 terminal
+     */
+    XEN_CONSOLE_PROTOCOL_VT100,
+
+    /**
+     * Remote FrameBuffer protocol (as used in VNC)
+     */
+    XEN_CONSOLE_PROTOCOL_RFB,
+
+    /**
+     * Remote Desktop Protocol
+     */
+    XEN_CONSOLE_PROTOCOL_RDP
+};
+
+
+typedef struct xen_console_protocol_set
+{
+    size_t size;
+    enum xen_console_protocol contents[];
+} xen_console_protocol_set;
+
+/**
+ * Allocate a xen_console_protocol_set of the given size.
+ */
+extern xen_console_protocol_set *
+xen_console_protocol_set_alloc(size_t size);
+
+/**
+ * Free the given xen_console_protocol_set.  The given set must have
+ * been allocated by this library.
+ */
+extern void
+xen_console_protocol_set_free(xen_console_protocol_set *set);
+
+
+/**
+ * Return the name corresponding to the given code.  This string must
+ * not be modified or freed.
+ */
+extern const char *
+xen_console_protocol_to_string(enum xen_console_protocol val);
+
+
+/**
+ * Return the correct code for the given string, or set the session
+ * object to failure and return an undefined value if the given string does
+ * not match a known code.
+ */
+extern enum xen_console_protocol
+xen_console_protocol_from_string(xen_session *session, const char *str);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_crashdump.h b/tools/libxen/include/xen/api/xen_crashdump.h
new file mode 100644 (file)
index 0000000..145e041
--- /dev/null
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_CRASHDUMP_H
+#define XEN_CRASHDUMP_H
+
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_crashdump_decl.h>
+#include <xen/api/xen_vdi_decl.h>
+#include <xen/api/xen_vm_decl.h>
+
+
+/*
+ * The crashdump class.
+ * 
+ * A VM crashdump.
+ */
+
+
+/**
+ * Free the given xen_crashdump.  The given handle must have been
+ * allocated by this library.
+ */
+extern void
+xen_crashdump_free(xen_crashdump crashdump);
+
+
+typedef struct xen_crashdump_set
+{
+    size_t size;
+    xen_crashdump *contents[];
+} xen_crashdump_set;
+
+/**
+ * Allocate a xen_crashdump_set of the given size.
+ */
+extern xen_crashdump_set *
+xen_crashdump_set_alloc(size_t size);
+
+/**
+ * Free the given xen_crashdump_set.  The given set must have been
+ * allocated by this library.
+ */
+extern void
+xen_crashdump_set_free(xen_crashdump_set *set);
+
+
+typedef struct xen_crashdump_record
+{
+    xen_crashdump handle;
+    char *uuid;
+    struct xen_vm_record_opt *vm;
+    struct xen_vdi_record_opt *vdi;
+} xen_crashdump_record;
+
+/**
+ * Allocate a xen_crashdump_record.
+ */
+extern xen_crashdump_record *
+xen_crashdump_record_alloc(void);
+
+/**
+ * Free the given xen_crashdump_record, and all referenced values.  The
+ * given record must have been allocated by this library.
+ */
+extern void
+xen_crashdump_record_free(xen_crashdump_record *record);
+
+
+typedef struct xen_crashdump_record_opt
+{
+    bool is_record;
+    union
+    {
+        xen_crashdump handle;
+        xen_crashdump_record *record;
+    } u;
+} xen_crashdump_record_opt;
+
+/**
+ * Allocate a xen_crashdump_record_opt.
+ */
+extern xen_crashdump_record_opt *
+xen_crashdump_record_opt_alloc(void);
+
+/**
+ * Free the given xen_crashdump_record_opt, and all referenced values. 
+ * The given record_opt must have been allocated by this library.
+ */
+extern void
+xen_crashdump_record_opt_free(xen_crashdump_record_opt *record_opt);
+
+
+typedef struct xen_crashdump_record_set
+{
+    size_t size;
+    xen_crashdump_record *contents[];
+} xen_crashdump_record_set;
+
+/**
+ * Allocate a xen_crashdump_record_set of the given size.
+ */
+extern xen_crashdump_record_set *
+xen_crashdump_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_crashdump_record_set, and all referenced values. 
+ * The given set must have been allocated by this library.
+ */
+extern void
+xen_crashdump_record_set_free(xen_crashdump_record_set *set);
+
+
+
+typedef struct xen_crashdump_record_opt_set
+{
+    size_t size;
+    xen_crashdump_record_opt *contents[];
+} xen_crashdump_record_opt_set;
+
+/**
+ * Allocate a xen_crashdump_record_opt_set of the given size.
+ */
+extern xen_crashdump_record_opt_set *
+xen_crashdump_record_opt_set_alloc(size_t size);
+
+/**
+ * Free the given xen_crashdump_record_opt_set, and all referenced
+ * values.  The given set must have been allocated by this library.
+ */
+extern void
+xen_crashdump_record_opt_set_free(xen_crashdump_record_opt_set *set);
+
+
+/**
+ * Get a record containing the current state of the given crashdump.
+ */
+extern bool
+xen_crashdump_get_record(xen_session *session, xen_crashdump_record **result, xen_crashdump crashdump);
+
+
+/**
+ * Get a reference to the crashdump instance with the specified UUID.
+ */
+extern bool
+xen_crashdump_get_by_uuid(xen_session *session, xen_crashdump *result, char *uuid);
+
+
+/**
+ * Get the uuid field of the given crashdump.
+ */
+extern bool
+xen_crashdump_get_uuid(xen_session *session, char **result, xen_crashdump crashdump);
+
+
+/**
+ * Get the VM field of the given crashdump.
+ */
+extern bool
+xen_crashdump_get_vm(xen_session *session, xen_vm *result, xen_crashdump crashdump);
+
+
+/**
+ * Get the VDI field of the given crashdump.
+ */
+extern bool
+xen_crashdump_get_vdi(xen_session *session, xen_vdi *result, xen_crashdump crashdump);
+
+
+/**
+ * Destroy the specified crashdump.
+ */
+extern bool
+xen_crashdump_destroy(xen_session *session, xen_crashdump self);
+
+
+/**
+ * Return a list of all the crashdumps known to the system.
+ */
+extern bool
+xen_crashdump_get_all(xen_session *session, struct xen_crashdump_set **result);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_crashdump_decl.h b/tools/libxen/include/xen/api/xen_crashdump_decl.h
new file mode 100644 (file)
index 0000000..4eb6d54
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_CRASHDUMP_DECL_H
+#define XEN_CRASHDUMP_DECL_H
+
+typedef void *xen_crashdump;
+
+struct xen_crashdump_set;
+struct xen_crashdump_record;
+struct xen_crashdump_record_set;
+struct xen_crashdump_record_opt;
+struct xen_crashdump_record_opt_set;
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_event.h b/tools/libxen/include/xen/api/xen_event.h
new file mode 100644 (file)
index 0000000..6a2845b
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_EVENT_H
+#define XEN_EVENT_H
+
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_event_decl.h>
+#include <xen/api/xen_event_operation.h>
+#include <xen/api/xen_string_set.h>
+
+
+/*
+ * The event class.
+ * 
+ * Asynchronous event registration and handling.
+ */
+
+
+
+typedef struct xen_event_record
+{
+    int64_t id;
+    time_t timestamp;
+    char *class;
+    enum xen_event_operation operation;
+    char *ref;
+    char *obj_uuid;
+} xen_event_record;
+
+/**
+ * Allocate a xen_event_record.
+ */
+extern xen_event_record *
+xen_event_record_alloc(void);
+
+/**
+ * Free the given xen_event_record, and all referenced values.  The
+ * given record must have been allocated by this library.
+ */
+extern void
+xen_event_record_free(xen_event_record *record);
+
+
+typedef struct xen_event_record_set
+{
+    size_t size;
+    xen_event_record *contents[];
+} xen_event_record_set;
+
+/**
+ * Allocate a xen_event_record_set of the given size.
+ */
+extern xen_event_record_set *
+xen_event_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_event_record_set, and all referenced values.  The
+ * given set must have been allocated by this library.
+ */
+extern void
+xen_event_record_set_free(xen_event_record_set *set);
+
+
+/**
+ * Registers this session with the event system.  Specifying the empty
+ * list will register for all classes.
+ */
+extern bool
+xen_event_register(xen_session *session, struct xen_string_set *classes);
+
+
+/**
+ * Unregisters this session with the event system.
+ */
+extern bool
+xen_event_unregister(xen_session *session, struct xen_string_set *classes);
+
+
+/**
+ * Blocking call which returns a (possibly empty) batch of events.
+ */
+extern bool
+xen_event_next(xen_session *session, struct xen_event_record_set **result);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_event_decl.h b/tools/libxen/include/xen/api/xen_event_decl.h
new file mode 100644 (file)
index 0000000..856991f
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_EVENT_DECL_H
+#define XEN_EVENT_DECL_H
+
+struct xen_event_record;
+struct xen_event_record_set;
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_event_operation.h b/tools/libxen/include/xen/api/xen_event_operation.h
new file mode 100644 (file)
index 0000000..31cce20
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_EVENT_OPERATION_H
+#define XEN_EVENT_OPERATION_H
+
+
+#include <xen/api/xen_common.h>
+
+
+enum xen_event_operation
+{
+    /**
+     * An object has been created
+     */
+    XEN_EVENT_OPERATION_ADD,
+
+    /**
+     * An object has been deleted
+     */
+    XEN_EVENT_OPERATION_DEL,
+
+    /**
+     * An object has been modified
+     */
+    XEN_EVENT_OPERATION_MOD
+};
+
+
+typedef struct xen_event_operation_set
+{
+    size_t size;
+    enum xen_event_operation contents[];
+} xen_event_operation_set;
+
+/**
+ * Allocate a xen_event_operation_set of the given size.
+ */
+extern xen_event_operation_set *
+xen_event_operation_set_alloc(size_t size);
+
+/**
+ * Free the given xen_event_operation_set.  The given set must have
+ * been allocated by this library.
+ */
+extern void
+xen_event_operation_set_free(xen_event_operation_set *set);
+
+
+/**
+ * Return the name corresponding to the given code.  This string must
+ * not be modified or freed.
+ */
+extern const char *
+xen_event_operation_to_string(enum xen_event_operation val);
+
+
+/**
+ * Return the correct code for the given string, or set the session
+ * object to failure and return an undefined value if the given string does
+ * not match a known code.
+ */
+extern enum xen_event_operation
+xen_event_operation_from_string(xen_session *session, const char *str);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_host.h b/tools/libxen/include/xen/api/xen_host.h
new file mode 100644 (file)
index 0000000..9ca40d7
--- /dev/null
@@ -0,0 +1,497 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_HOST_H
+#define XEN_HOST_H
+
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_host_cpu_decl.h>
+#include <xen/api/xen_host_decl.h>
+#include <xen/api/xen_host_metrics_decl.h>
+#include <xen/api/xen_pbd_decl.h>
+#include <xen/api/xen_pif_decl.h>
+#include <xen/api/xen_sr_decl.h>
+#include <xen/api/xen_string_set.h>
+#include <xen/api/xen_string_string_map.h>
+#include <xen/api/xen_vm_decl.h>
+
+
+/*
+ * The host class.
+ * 
+ * A physical host.
+ */
+
+
+/**
+ * Free the given xen_host.  The given handle must have been allocated
+ * by this library.
+ */
+extern void
+xen_host_free(xen_host host);
+
+
+typedef struct xen_host_set
+{
+    size_t size;
+    xen_host *contents[];
+} xen_host_set;
+
+/**
+ * Allocate a xen_host_set of the given size.
+ */
+extern xen_host_set *
+xen_host_set_alloc(size_t size);
+
+/**
+ * Free the given xen_host_set.  The given set must have been allocated
+ * by this library.
+ */
+extern void
+xen_host_set_free(xen_host_set *set);
+
+
+typedef struct xen_host_record
+{
+    xen_host handle;
+    char *uuid;
+    char *name_label;
+    char *name_description;
+    int64_t api_version_major;
+    int64_t api_version_minor;
+    char *api_version_vendor;
+    xen_string_string_map *api_version_vendor_implementation;
+    bool enabled;
+    xen_string_string_map *software_version;
+    xen_string_string_map *other_config;
+    struct xen_string_set *capabilities;
+    xen_string_string_map *cpu_configuration;
+    char *sched_policy;
+    struct xen_string_set *supported_bootloaders;
+    struct xen_vm_record_opt_set *resident_vms;
+    xen_string_string_map *logging;
+    struct xen_pif_record_opt_set *pifs;
+    struct xen_sr_record_opt *suspend_image_sr;
+    struct xen_sr_record_opt *crash_dump_sr;
+    struct xen_pbd_record_opt_set *pbds;
+    struct xen_host_cpu_record_opt_set *host_cpus;
+    struct xen_host_metrics_record_opt *metrics;
+} xen_host_record;
+
+/**
+ * Allocate a xen_host_record.
+ */
+extern xen_host_record *
+xen_host_record_alloc(void);
+
+/**
+ * Free the given xen_host_record, and all referenced values.  The
+ * given record must have been allocated by this library.
+ */
+extern void
+xen_host_record_free(xen_host_record *record);
+
+
+typedef struct xen_host_record_opt
+{
+    bool is_record;
+    union
+    {
+        xen_host handle;
+        xen_host_record *record;
+    } u;
+} xen_host_record_opt;
+
+/**
+ * Allocate a xen_host_record_opt.
+ */
+extern xen_host_record_opt *
+xen_host_record_opt_alloc(void);
+
+/**
+ * Free the given xen_host_record_opt, and all referenced values.  The
+ * given record_opt must have been allocated by this library.
+ */
+extern void
+xen_host_record_opt_free(xen_host_record_opt *record_opt);
+
+
+typedef struct xen_host_record_set
+{
+    size_t size;
+    xen_host_record *contents[];
+} xen_host_record_set;
+
+/**
+ * Allocate a xen_host_record_set of the given size.
+ */
+extern xen_host_record_set *
+xen_host_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_host_record_set, and all referenced values.  The
+ * given set must have been allocated by this library.
+ */
+extern void
+xen_host_record_set_free(xen_host_record_set *set);
+
+
+
+typedef struct xen_host_record_opt_set
+{
+    size_t size;
+    xen_host_record_opt *contents[];
+} xen_host_record_opt_set;
+
+/**
+ * Allocate a xen_host_record_opt_set of the given size.
+ */
+extern xen_host_record_opt_set *
+xen_host_record_opt_set_alloc(size_t size);
+
+/**
+ * Free the given xen_host_record_opt_set, and all referenced values. 
+ * The given set must have been allocated by this library.
+ */
+extern void
+xen_host_record_opt_set_free(xen_host_record_opt_set *set);
+
+
+/**
+ * Get a record containing the current state of the given host.
+ */
+extern bool
+xen_host_get_record(xen_session *session, xen_host_record **result, xen_host host);
+
+
+/**
+ * Get a reference to the host instance with the specified UUID.
+ */
+extern bool
+xen_host_get_by_uuid(xen_session *session, xen_host *result, char *uuid);
+
+
+/**
+ * Get all the host instances with the given label.
+ */
+extern bool
+xen_host_get_by_name_label(xen_session *session, struct xen_host_set **result, char *label);
+
+
+/**
+ * Get the uuid field of the given host.
+ */
+extern bool
+xen_host_get_uuid(xen_session *session, char **result, xen_host host);
+
+
+/**
+ * Get the name/label field of the given host.
+ */
+extern bool
+xen_host_get_name_label(xen_session *session, char **result, xen_host host);
+
+
+/**
+ * Get the name/description field of the given host.
+ */
+extern bool
+xen_host_get_name_description(xen_session *session, char **result, xen_host host);
+
+
+/**
+ * Get the API_version/major field of the given host.
+ */
+extern bool
+xen_host_get_api_version_major(xen_session *session, int64_t *result, xen_host host);
+
+
+/**
+ * Get the API_version/minor field of the given host.
+ */
+extern bool
+xen_host_get_api_version_minor(xen_session *session, int64_t *result, xen_host host);
+
+
+/**
+ * Get the API_version/vendor field of the given host.
+ */
+extern bool
+xen_host_get_api_version_vendor(xen_session *session, char **result, xen_host host);
+
+
+/**
+ * Get the API_version/vendor_implementation field of the given host.
+ */
+extern bool
+xen_host_get_api_version_vendor_implementation(xen_session *session, xen_string_string_map **result, xen_host host);
+
+
+/**
+ * Get the enabled field of the given host.
+ */
+extern bool
+xen_host_get_enabled(xen_session *session, bool *result, xen_host host);
+
+
+/**
+ * Get the software_version field of the given host.
+ */
+extern bool
+xen_host_get_software_version(xen_session *session, xen_string_string_map **result, xen_host host);
+
+
+/**
+ * Get the other_config field of the given host.
+ */
+extern bool
+xen_host_get_other_config(xen_session *session, xen_string_string_map **result, xen_host host);
+
+
+/**
+ * Get the capabilities field of the given host.
+ */
+extern bool
+xen_host_get_capabilities(xen_session *session, struct xen_string_set **result, xen_host host);
+
+
+/**
+ * Get the cpu_configuration field of the given host.
+ */
+extern bool
+xen_host_get_cpu_configuration(xen_session *session, xen_string_string_map **result, xen_host host);
+
+
+/**
+ * Get the sched_policy field of the given host.
+ */
+extern bool
+xen_host_get_sched_policy(xen_session *session, char **result, xen_host host);
+
+
+/**
+ * Get the supported_bootloaders field of the given host.
+ */
+extern bool
+xen_host_get_supported_bootloaders(xen_session *session, struct xen_string_set **result, xen_host host);
+
+
+/**
+ * Get the resident_VMs field of the given host.
+ */
+extern bool
+xen_host_get_resident_vms(xen_session *session, struct xen_vm_set **result, xen_host host);
+
+
+/**
+ * Get the logging field of the given host.
+ */
+extern bool
+xen_host_get_logging(xen_session *session, xen_string_string_map **result, xen_host host);
+
+
+/**
+ * Get the PIFs field of the given host.
+ */
+extern bool
+xen_host_get_pifs(xen_session *session, struct xen_pif_set **result, xen_host host);
+
+
+/**
+ * Get the suspend_image_sr field of the given host.
+ */
+extern bool
+xen_host_get_suspend_image_sr(xen_session *session, xen_sr *result, xen_host host);
+
+
+/**
+ * Get the crash_dump_sr field of the given host.
+ */
+extern bool
+xen_host_get_crash_dump_sr(xen_session *session, xen_sr *result, xen_host host);
+
+
+/**
+ * Get the PBDs field of the given host.
+ */
+extern bool
+xen_host_get_pbds(xen_session *session, struct xen_pbd_set **result, xen_host host);
+
+
+/**
+ * Get the host_CPUs field of the given host.
+ */
+extern bool
+xen_host_get_host_cpus(xen_session *session, struct xen_host_cpu_set **result, xen_host host);
+
+
+/**
+ * Get the metrics field of the given host.
+ */
+extern bool
+xen_host_get_metrics(xen_session *session, xen_host_metrics *result, xen_host host);
+
+
+/**
+ * Set the name/label field of the given host.
+ */
+extern bool
+xen_host_set_name_label(xen_session *session, xen_host host, char *label);
+
+
+/**
+ * Set the name/description field of the given host.
+ */
+extern bool
+xen_host_set_name_description(xen_session *session, xen_host host, char *description);
+
+
+/**
+ * Set the other_config field of the given host.
+ */
+extern bool
+xen_host_set_other_config(xen_session *session, xen_host host, xen_string_string_map *other_config);
+
+
+/**
+ * Add the given key-value pair to the other_config field of the given
+ * host.
+ */
+extern bool
+xen_host_add_to_other_config(xen_session *session, xen_host host, char *key, char *value);
+
+
+/**
+ * Remove the given key and its corresponding value from the
+ * other_config field of the given host.  If the key is not in that Map, then
+ * do nothing.
+ */
+extern bool
+xen_host_remove_from_other_config(xen_session *session, xen_host host, char *key);
+
+
+/**
+ * Set the logging field of the given host.
+ */
+extern bool
+xen_host_set_logging(xen_session *session, xen_host host, xen_string_string_map *logging);
+
+
+/**
+ * Add the given key-value pair to the logging field of the given host.
+ */
+extern bool
+xen_host_add_to_logging(xen_session *session, xen_host host, char *key, char *value);
+
+
+/**
+ * Remove the given key and its corresponding value from the logging
+ * field of the given host.  If the key is not in that Map, then do nothing.
+ */
+extern bool
+xen_host_remove_from_logging(xen_session *session, xen_host host, char *key);
+
+
+/**
+ * Set the suspend_image_sr field of the given host.
+ */
+extern bool
+xen_host_set_suspend_image_sr(xen_session *session, xen_host host, xen_sr suspend_image_sr);
+
+
+/**
+ * Set the crash_dump_sr field of the given host.
+ */
+extern bool
+xen_host_set_crash_dump_sr(xen_session *session, xen_host host, xen_sr crash_dump_sr);
+
+
+/**
+ * Puts the host into a state in which no new VMs can be started.
+ * Currently active VMs on the host continue to execute.
+ */
+extern bool
+xen_host_disable(xen_session *session, xen_host host);
+
+
+/**
+ * Puts the host into a state in which new VMs can be started.
+ */
+extern bool
+xen_host_enable(xen_session *session, xen_host host);
+
+
+/**
+ * Shutdown the host. (This function can only be called if there are no
+ * currently running VMs on the host and it is disabled.).
+ */
+extern bool
+xen_host_shutdown(xen_session *session, xen_host host);
+
+
+/**
+ * Reboot the host. (This function can only be called if there are no
+ * currently running VMs on the host and it is disabled.).
+ */
+extern bool
+xen_host_reboot(xen_session *session, xen_host host);
+
+
+/**
+ * Get the host xen dmesg.
+ */
+extern bool
+xen_host_dmesg(xen_session *session, char **result, xen_host host);
+
+
+/**
+ * Get the host xen dmesg, and clear the buffer.
+ */
+extern bool
+xen_host_dmesg_clear(xen_session *session, char **result, xen_host host);
+
+
+/**
+ * Get the host's log file.
+ */
+extern bool
+xen_host_get_log(xen_session *session, char **result, xen_host host);
+
+
+/**
+ * Inject the given string as debugging keys into Xen.
+ */
+extern bool
+xen_host_send_debug_keys(xen_session *session, xen_host host, char *keys);
+
+
+/**
+ * List all supported methods.
+ */
+extern bool
+xen_host_list_methods(xen_session *session, struct xen_string_set **result);
+
+
+/**
+ * Return a list of all the hosts known to the system.
+ */
+extern bool
+xen_host_get_all(xen_session *session, struct xen_host_set **result);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_host_cpu.h b/tools/libxen/include/xen/api/xen_host_cpu.h
new file mode 100644 (file)
index 0000000..f1bdb71
--- /dev/null
@@ -0,0 +1,247 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_HOST_CPU_H
+#define XEN_HOST_CPU_H
+
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_host_cpu_decl.h>
+#include <xen/api/xen_host_decl.h>
+
+
+/*
+ * The host_cpu class.
+ * 
+ * A physical CPU.
+ */
+
+
+/**
+ * Free the given xen_host_cpu.  The given handle must have been
+ * allocated by this library.
+ */
+extern void
+xen_host_cpu_free(xen_host_cpu host_cpu);
+
+
+typedef struct xen_host_cpu_set
+{
+    size_t size;
+    xen_host_cpu *contents[];
+} xen_host_cpu_set;
+
+/**
+ * Allocate a xen_host_cpu_set of the given size.
+ */
+extern xen_host_cpu_set *
+xen_host_cpu_set_alloc(size_t size);
+
+/**
+ * Free the given xen_host_cpu_set.  The given set must have been
+ * allocated by this library.
+ */
+extern void
+xen_host_cpu_set_free(xen_host_cpu_set *set);
+
+
+typedef struct xen_host_cpu_record
+{
+    xen_host_cpu handle;
+    char *uuid;
+    struct xen_host_record_opt *host;
+    int64_t number;
+    char *vendor;
+    int64_t speed;
+    char *modelname;
+    char *stepping;
+    char *flags;
+    char *features;
+    double utilisation;
+} xen_host_cpu_record;
+
+/**
+ * Allocate a xen_host_cpu_record.
+ */
+extern xen_host_cpu_record *
+xen_host_cpu_record_alloc(void);
+
+/**
+ * Free the given xen_host_cpu_record, and all referenced values.  The
+ * given record must have been allocated by this library.
+ */
+extern void
+xen_host_cpu_record_free(xen_host_cpu_record *record);
+
+
+typedef struct xen_host_cpu_record_opt
+{
+    bool is_record;
+    union
+    {
+        xen_host_cpu handle;
+        xen_host_cpu_record *record;
+    } u;
+} xen_host_cpu_record_opt;
+
+/**
+ * Allocate a xen_host_cpu_record_opt.
+ */
+extern xen_host_cpu_record_opt *
+xen_host_cpu_record_opt_alloc(void);
+
+/**
+ * Free the given xen_host_cpu_record_opt, and all referenced values. 
+ * The given record_opt must have been allocated by this library.
+ */
+extern void
+xen_host_cpu_record_opt_free(xen_host_cpu_record_opt *record_opt);
+
+
+typedef struct xen_host_cpu_record_set
+{
+    size_t size;
+    xen_host_cpu_record *contents[];
+} xen_host_cpu_record_set;
+
+/**
+ * Allocate a xen_host_cpu_record_set of the given size.
+ */
+extern xen_host_cpu_record_set *
+xen_host_cpu_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_host_cpu_record_set, and all referenced values. 
+ * The given set must have been allocated by this library.
+ */
+extern void
+xen_host_cpu_record_set_free(xen_host_cpu_record_set *set);
+
+
+
+typedef struct xen_host_cpu_record_opt_set
+{
+    size_t size;
+    xen_host_cpu_record_opt *contents[];
+} xen_host_cpu_record_opt_set;
+
+/**
+ * Allocate a xen_host_cpu_record_opt_set of the given size.
+ */
+extern xen_host_cpu_record_opt_set *
+xen_host_cpu_record_opt_set_alloc(size_t size);
+
+/**
+ * Free the given xen_host_cpu_record_opt_set, and all referenced
+ * values.  The given set must have been allocated by this library.
+ */
+extern void
+xen_host_cpu_record_opt_set_free(xen_host_cpu_record_opt_set *set);
+
+
+/**
+ * Get a record containing the current state of the given host_cpu.
+ */
+extern bool
+xen_host_cpu_get_record(xen_session *session, xen_host_cpu_record **result, xen_host_cpu host_cpu);
+
+
+/**
+ * Get a reference to the host_cpu instance with the specified UUID.
+ */
+extern bool
+xen_host_cpu_get_by_uuid(xen_session *session, xen_host_cpu *result, char *uuid);
+
+
+/**
+ * Get the uuid field of the given host_cpu.
+ */
+extern bool
+xen_host_cpu_get_uuid(xen_session *session, char **result, xen_host_cpu host_cpu);
+
+
+/**
+ * Get the host field of the given host_cpu.
+ */
+extern bool
+xen_host_cpu_get_host(xen_session *session, xen_host *result, xen_host_cpu host_cpu);
+
+
+/**
+ * Get the number field of the given host_cpu.
+ */
+extern bool
+xen_host_cpu_get_number(xen_session *session, int64_t *result, xen_host_cpu host_cpu);
+
+
+/**
+ * Get the vendor field of the given host_cpu.
+ */
+extern bool
+xen_host_cpu_get_vendor(xen_session *session, char **result, xen_host_cpu host_cpu);
+
+
+/**
+ * Get the speed field of the given host_cpu.
+ */
+extern bool
+xen_host_cpu_get_speed(xen_session *session, int64_t *result, xen_host_cpu host_cpu);
+
+
+/**
+ * Get the modelname field of the given host_cpu.
+ */
+extern bool
+xen_host_cpu_get_modelname(xen_session *session, char **result, xen_host_cpu host_cpu);
+
+
+/**
+ * Get the stepping field of the given host_cpu.
+ */
+extern bool
+xen_host_cpu_get_stepping(xen_session *session, char **result, xen_host_cpu host_cpu);
+
+
+/**
+ * Get the flags field of the given host_cpu.
+ */
+extern bool
+xen_host_cpu_get_flags(xen_session *session, char **result, xen_host_cpu host_cpu);
+
+
+/**
+ * Get the features field of the given host_cpu.
+ */
+extern bool
+xen_host_cpu_get_features(xen_session *session, char **result, xen_host_cpu host_cpu);
+
+
+/**
+ * Get the utilisation field of the given host_cpu.
+ */
+extern bool
+xen_host_cpu_get_utilisation(xen_session *session, double *result, xen_host_cpu host_cpu);
+
+
+/**
+ * Return a list of all the host_cpus known to the system.
+ */
+extern bool
+xen_host_cpu_get_all(xen_session *session, struct xen_host_cpu_set **result);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_host_cpu_decl.h b/tools/libxen/include/xen/api/xen_host_cpu_decl.h
new file mode 100644 (file)
index 0000000..1e9be29
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_HOST_CPU_DECL_H
+#define XEN_HOST_CPU_DECL_H
+
+typedef void *xen_host_cpu;
+
+struct xen_host_cpu_set;
+struct xen_host_cpu_record;
+struct xen_host_cpu_record_set;
+struct xen_host_cpu_record_opt;
+struct xen_host_cpu_record_opt_set;
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_host_decl.h b/tools/libxen/include/xen/api/xen_host_decl.h
new file mode 100644 (file)
index 0000000..79d974b
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_HOST_DECL_H
+#define XEN_HOST_DECL_H
+
+typedef void *xen_host;
+
+struct xen_host_set;
+struct xen_host_record;
+struct xen_host_record_set;
+struct xen_host_record_opt;
+struct xen_host_record_opt_set;
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_host_metrics.h b/tools/libxen/include/xen/api/xen_host_metrics.h
new file mode 100644 (file)
index 0000000..2055362
--- /dev/null
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_HOST_METRICS_H
+#define XEN_HOST_METRICS_H
+
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_host_metrics_decl.h>
+
+
+/*
+ * The host_metrics class.
+ * 
+ * The metrics associated with a host.
+ */
+
+
+/**
+ * Free the given xen_host_metrics.  The given handle must have been
+ * allocated by this library.
+ */
+extern void
+xen_host_metrics_free(xen_host_metrics host_metrics);
+
+
+typedef struct xen_host_metrics_set
+{
+    size_t size;
+    xen_host_metrics *contents[];
+} xen_host_metrics_set;
+
+/**
+ * Allocate a xen_host_metrics_set of the given size.
+ */
+extern xen_host_metrics_set *
+xen_host_metrics_set_alloc(size_t size);
+
+/**
+ * Free the given xen_host_metrics_set.  The given set must have been
+ * allocated by this library.
+ */
+extern void
+xen_host_metrics_set_free(xen_host_metrics_set *set);
+
+
+typedef struct xen_host_metrics_record
+{
+    xen_host_metrics handle;
+    char *uuid;
+    int64_t memory_total;
+    int64_t memory_free;
+    time_t last_updated;
+} xen_host_metrics_record;
+
+/**
+ * Allocate a xen_host_metrics_record.
+ */
+extern xen_host_metrics_record *
+xen_host_metrics_record_alloc(void);
+
+/**
+ * Free the given xen_host_metrics_record, and all referenced values. 
+ * The given record must have been allocated by this library.
+ */
+extern void
+xen_host_metrics_record_free(xen_host_metrics_record *record);
+
+
+typedef struct xen_host_metrics_record_opt
+{
+    bool is_record;
+    union
+    {
+        xen_host_metrics handle;
+        xen_host_metrics_record *record;
+    } u;
+} xen_host_metrics_record_opt;
+
+/**
+ * Allocate a xen_host_metrics_record_opt.
+ */
+extern xen_host_metrics_record_opt *
+xen_host_metrics_record_opt_alloc(void);
+
+/**
+ * Free the given xen_host_metrics_record_opt, and all referenced
+ * values.  The given record_opt must have been allocated by this library.
+ */
+extern void
+xen_host_metrics_record_opt_free(xen_host_metrics_record_opt *record_opt);
+
+
+typedef struct xen_host_metrics_record_set
+{
+    size_t size;
+    xen_host_metrics_record *contents[];
+} xen_host_metrics_record_set;
+
+/**
+ * Allocate a xen_host_metrics_record_set of the given size.
+ */
+extern xen_host_metrics_record_set *
+xen_host_metrics_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_host_metrics_record_set, and all referenced
+ * values.  The given set must have been allocated by this library.
+ */
+extern void
+xen_host_metrics_record_set_free(xen_host_metrics_record_set *set);
+
+
+
+typedef struct xen_host_metrics_record_opt_set
+{
+    size_t size;
+    xen_host_metrics_record_opt *contents[];
+} xen_host_metrics_record_opt_set;
+
+/**
+ * Allocate a xen_host_metrics_record_opt_set of the given size.
+ */
+extern xen_host_metrics_record_opt_set *
+xen_host_metrics_record_opt_set_alloc(size_t size);
+
+/**
+ * Free the given xen_host_metrics_record_opt_set, and all referenced
+ * values.  The given set must have been allocated by this library.
+ */
+extern void
+xen_host_metrics_record_opt_set_free(xen_host_metrics_record_opt_set *set);
+
+
+/**
+ * Get a record containing the current state of the given host_metrics.
+ */
+extern bool
+xen_host_metrics_get_record(xen_session *session, xen_host_metrics_record **result, xen_host_metrics host_metrics);
+
+
+/**
+ * Get a reference to the host_metrics instance with the specified
+ * UUID.
+ */
+extern bool
+xen_host_metrics_get_by_uuid(xen_session *session, xen_host_metrics *result, char *uuid);
+
+
+/**
+ * Get the uuid field of the given host_metrics.
+ */
+extern bool
+xen_host_metrics_get_uuid(xen_session *session, char **result, xen_host_metrics host_metrics);
+
+
+/**
+ * Get the memory/total field of the given host_metrics.
+ */
+extern bool
+xen_host_metrics_get_memory_total(xen_session *session, int64_t *result, xen_host_metrics host_metrics);
+
+
+/**
+ * Get the memory/free field of the given host_metrics.
+ */
+extern bool
+xen_host_metrics_get_memory_free(xen_session *session, int64_t *result, xen_host_metrics host_metrics);
+
+
+/**
+ * Get the last_updated field of the given host_metrics.
+ */
+extern bool
+xen_host_metrics_get_last_updated(xen_session *session, time_t *result, xen_host_metrics host_metrics);
+
+
+/**
+ * Return a list of all the host_metrics instances known to the system.
+ */
+extern bool
+xen_host_metrics_get_all(xen_session *session, struct xen_host_metrics_set **result);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_host_metrics_decl.h b/tools/libxen/include/xen/api/xen_host_metrics_decl.h
new file mode 100644 (file)
index 0000000..8b73554
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_HOST_METRICS_DECL_H
+#define XEN_HOST_METRICS_DECL_H
+
+typedef void *xen_host_metrics;
+
+struct xen_host_metrics_set;
+struct xen_host_metrics_record;
+struct xen_host_metrics_record_set;
+struct xen_host_metrics_record_opt;
+struct xen_host_metrics_record_opt_set;
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_int_float_map.h b/tools/libxen/include/xen/api/xen_int_float_map.h
new file mode 100644 (file)
index 0000000..058c45e
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_INT_FLOAT_MAP_H
+#define XEN_INT_FLOAT_MAP_H
+
+
+#include <xen/api/xen_common.h>
+
+
+typedef struct xen_int_float_map_contents
+{
+  int64_t key;
+  double val;
+} xen_int_float_map_contents;
+
+
+typedef struct xen_int_float_map
+{
+    size_t size;
+    xen_int_float_map_contents contents[];
+} xen_int_float_map;
+
+/**
+ * Allocate a xen_int_float_map of the given size.
+ */
+extern xen_int_float_map *
+xen_int_float_map_alloc(size_t size);
+
+/**
+ * Free the given xen_int_float_map, and all referenced values.  The
+ * given map must have been allocated by this library.
+ */
+extern void
+xen_int_float_map_free(xen_int_float_map *map);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_int_int_map.h b/tools/libxen/include/xen/api/xen_int_int_map.h
new file mode 100644 (file)
index 0000000..71295a6
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_INT_INT_MAP_H
+#define XEN_INT_INT_MAP_H
+
+
+#include <xen/api/xen_common.h>
+
+
+typedef struct xen_int_int_map_contents
+{
+  int64_t key;
+  int64_t val;
+} xen_int_int_map_contents;
+
+
+typedef struct xen_int_int_map
+{
+    size_t size;
+    xen_int_int_map_contents contents[];
+} xen_int_int_map;
+
+/**
+ * Allocate a xen_int_int_map of the given size.
+ */
+extern xen_int_int_map *
+xen_int_int_map_alloc(size_t size);
+
+/**
+ * Free the given xen_int_int_map, and all referenced values.  The
+ * given map must have been allocated by this library.
+ */
+extern void
+xen_int_int_map_free(xen_int_int_map *map);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_int_string_set_map.h b/tools/libxen/include/xen/api/xen_int_string_set_map.h
new file mode 100644 (file)
index 0000000..bca1a6b
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_INT_STRING_SET_MAP_H
+#define XEN_INT_STRING_SET_MAP_H
+
+
+#include <xen/api/xen_common.h>
+
+
+typedef struct xen_int_string_set_map_contents
+{
+  int64_t key;
+  struct xen_string_set *val;
+} xen_int_string_set_map_contents;
+
+
+typedef struct xen_int_string_set_map
+{
+    size_t size;
+    xen_int_string_set_map_contents contents[];
+} xen_int_string_set_map;
+
+/**
+ * Allocate a xen_int_string_set_map of the given size.
+ */
+extern xen_int_string_set_map *
+xen_int_string_set_map_alloc(size_t size);
+
+/**
+ * Free the given xen_int_string_set_map, and all referenced values. 
+ * The given map must have been allocated by this library.
+ */
+extern void
+xen_int_string_set_map_free(xen_int_string_set_map *map);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_network.h b/tools/libxen/include/xen/api/xen_network.h
new file mode 100644 (file)
index 0000000..bf8295a
--- /dev/null
@@ -0,0 +1,276 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_NETWORK_H
+#define XEN_NETWORK_H
+
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_network_decl.h>
+#include <xen/api/xen_pif_decl.h>
+#include <xen/api/xen_string_string_map.h>
+#include <xen/api/xen_vif_decl.h>
+
+
+/*
+ * The network class.
+ * 
+ * A virtual network.
+ */
+
+
+/**
+ * Free the given xen_network.  The given handle must have been
+ * allocated by this library.
+ */
+extern void
+xen_network_free(xen_network network);
+
+
+typedef struct xen_network_set
+{
+    size_t size;
+    xen_network *contents[];
+} xen_network_set;
+
+/**
+ * Allocate a xen_network_set of the given size.
+ */
+extern xen_network_set *
+xen_network_set_alloc(size_t size);
+
+/**
+ * Free the given xen_network_set.  The given set must have been
+ * allocated by this library.
+ */
+extern void
+xen_network_set_free(xen_network_set *set);
+
+
+typedef struct xen_network_record
+{
+    xen_network handle;
+    char *uuid;
+    char *name_label;
+    char *name_description;
+    struct xen_vif_record_opt_set *vifs;
+    struct xen_pif_record_opt_set *pifs;
+    xen_string_string_map *other_config;
+} xen_network_record;
+
+/**
+ * Allocate a xen_network_record.
+ */
+extern xen_network_record *
+xen_network_record_alloc(void);
+
+/**
+ * Free the given xen_network_record, and all referenced values.  The
+ * given record must have been allocated by this library.
+ */
+extern void
+xen_network_record_free(xen_network_record *record);
+
+
+typedef struct xen_network_record_opt
+{
+    bool is_record;
+    union
+    {
+        xen_network handle;
+        xen_network_record *record;
+    } u;
+} xen_network_record_opt;
+
+/**
+ * Allocate a xen_network_record_opt.
+ */
+extern xen_network_record_opt *
+xen_network_record_opt_alloc(void);
+
+/**
+ * Free the given xen_network_record_opt, and all referenced values. 
+ * The given record_opt must have been allocated by this library.
+ */
+extern void
+xen_network_record_opt_free(xen_network_record_opt *record_opt);
+
+
+typedef struct xen_network_record_set
+{
+    size_t size;
+    xen_network_record *contents[];
+} xen_network_record_set;
+
+/**
+ * Allocate a xen_network_record_set of the given size.
+ */
+extern xen_network_record_set *
+xen_network_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_network_record_set, and all referenced values. 
+ * The given set must have been allocated by this library.
+ */
+extern void
+xen_network_record_set_free(xen_network_record_set *set);
+
+
+
+typedef struct xen_network_record_opt_set
+{
+    size_t size;
+    xen_network_record_opt *contents[];
+} xen_network_record_opt_set;
+
+/**
+ * Allocate a xen_network_record_opt_set of the given size.
+ */
+extern xen_network_record_opt_set *
+xen_network_record_opt_set_alloc(size_t size);
+
+/**
+ * Free the given xen_network_record_opt_set, and all referenced
+ * values.  The given set must have been allocated by this library.
+ */
+extern void
+xen_network_record_opt_set_free(xen_network_record_opt_set *set);
+
+
+/**
+ * Get a record containing the current state of the given network.
+ */
+extern bool
+xen_network_get_record(xen_session *session, xen_network_record **result, xen_network network);
+
+
+/**
+ * Get a reference to the network instance with the specified UUID.
+ */
+extern bool
+xen_network_get_by_uuid(xen_session *session, xen_network *result, char *uuid);
+
+
+/**
+ * Create a new network instance, and return its handle.
+ */
+extern bool
+xen_network_create(xen_session *session, xen_network *result, xen_network_record *record);
+
+
+/**
+ * Destroy the specified network instance.
+ */
+extern bool
+xen_network_destroy(xen_session *session, xen_network network);
+
+
+/**
+ * Get all the network instances with the given label.
+ */
+extern bool
+xen_network_get_by_name_label(xen_session *session, struct xen_network_set **result, char *label);
+
+
+/**
+ * Get the uuid field of the given network.
+ */
+extern bool
+xen_network_get_uuid(xen_session *session, char **result, xen_network network);
+
+
+/**
+ * Get the name/label field of the given network.
+ */
+extern bool
+xen_network_get_name_label(xen_session *session, char **result, xen_network network);
+
+
+/**
+ * Get the name/description field of the given network.
+ */
+extern bool
+xen_network_get_name_description(xen_session *session, char **result, xen_network network);
+
+
+/**
+ * Get the VIFs field of the given network.
+ */
+extern bool
+xen_network_get_vifs(xen_session *session, struct xen_vif_set **result, xen_network network);
+
+
+/**
+ * Get the PIFs field of the given network.
+ */
+extern bool
+xen_network_get_pifs(xen_session *session, struct xen_pif_set **result, xen_network network);
+
+
+/**
+ * Get the other_config field of the given network.
+ */
+extern bool
+xen_network_get_other_config(xen_session *session, xen_string_string_map **result, xen_network network);
+
+
+/**
+ * Set the name/label field of the given network.
+ */
+extern bool
+xen_network_set_name_label(xen_session *session, xen_network network, char *label);
+
+
+/**
+ * Set the name/description field of the given network.
+ */
+extern bool
+xen_network_set_name_description(xen_session *session, xen_network network, char *description);
+
+
+/**
+ * Set the other_config field of the given network.
+ */
+extern bool
+xen_network_set_other_config(xen_session *session, xen_network network, xen_string_string_map *other_config);
+
+
+/**
+ * Add the given key-value pair to the other_config field of the given
+ * network.
+ */
+extern bool
+xen_network_add_to_other_config(xen_session *session, xen_network network, char *key, char *value);
+
+
+/**
+ * Remove the given key and its corresponding value from the
+ * other_config field of the given network.  If the key is not in that Map,
+ * then do nothing.
+ */
+extern bool
+xen_network_remove_from_other_config(xen_session *session, xen_network network, char *key);
+
+
+/**
+ * Return a list of all the networks known to the system.
+ */
+extern bool
+xen_network_get_all(xen_session *session, struct xen_network_set **result);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_network_decl.h b/tools/libxen/include/xen/api/xen_network_decl.h
new file mode 100644 (file)
index 0000000..dbfb3e9
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_NETWORK_DECL_H
+#define XEN_NETWORK_DECL_H
+
+typedef void *xen_network;
+
+struct xen_network_set;
+struct xen_network_record;
+struct xen_network_record_set;
+struct xen_network_record_opt;
+struct xen_network_record_opt_set;
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_on_crash_behaviour.h b/tools/libxen/include/xen/api/xen_on_crash_behaviour.h
new file mode 100644 (file)
index 0000000..47792c6
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_ON_CRASH_BEHAVIOUR_H
+#define XEN_ON_CRASH_BEHAVIOUR_H
+
+
+#include <xen/api/xen_common.h>
+
+
+enum xen_on_crash_behaviour
+{
+    /**
+     * destroy the VM state
+     */
+    XEN_ON_CRASH_BEHAVIOUR_DESTROY,
+
+    /**
+     * record a coredump and then destroy the VM state
+     */
+    XEN_ON_CRASH_BEHAVIOUR_COREDUMP_AND_DESTROY,
+
+    /**
+     * restart the VM
+     */
+    XEN_ON_CRASH_BEHAVIOUR_RESTART,
+
+    /**
+     * record a coredump and then restart the VM
+     */
+    XEN_ON_CRASH_BEHAVIOUR_COREDUMP_AND_RESTART,
+
+    /**
+     * leave the crashed VM as-is
+     */
+    XEN_ON_CRASH_BEHAVIOUR_PRESERVE,
+
+    /**
+     * rename the crashed VM and start a new copy
+     */
+    XEN_ON_CRASH_BEHAVIOUR_RENAME_RESTART
+};
+
+
+typedef struct xen_on_crash_behaviour_set
+{
+    size_t size;
+    enum xen_on_crash_behaviour contents[];
+} xen_on_crash_behaviour_set;
+
+/**
+ * Allocate a xen_on_crash_behaviour_set of the given size.
+ */
+extern xen_on_crash_behaviour_set *
+xen_on_crash_behaviour_set_alloc(size_t size);
+
+/**
+ * Free the given xen_on_crash_behaviour_set.  The given set must have
+ * been allocated by this library.
+ */
+extern void
+xen_on_crash_behaviour_set_free(xen_on_crash_behaviour_set *set);
+
+
+/**
+ * Return the name corresponding to the given code.  This string must
+ * not be modified or freed.
+ */
+extern const char *
+xen_on_crash_behaviour_to_string(enum xen_on_crash_behaviour val);
+
+
+/**
+ * Return the correct code for the given string, or set the session
+ * object to failure and return an undefined value if the given string does
+ * not match a known code.
+ */
+extern enum xen_on_crash_behaviour
+xen_on_crash_behaviour_from_string(xen_session *session, const char *str);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_on_normal_exit.h b/tools/libxen/include/xen/api/xen_on_normal_exit.h
new file mode 100644 (file)
index 0000000..cd5a813
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_ON_NORMAL_EXIT_H
+#define XEN_ON_NORMAL_EXIT_H
+
+
+#include <xen/api/xen_common.h>
+
+
+enum xen_on_normal_exit
+{
+    /**
+     * destroy the VM state
+     */
+    XEN_ON_NORMAL_EXIT_DESTROY,
+
+    /**
+     * restart the VM
+     */
+    XEN_ON_NORMAL_EXIT_RESTART
+};
+
+
+typedef struct xen_on_normal_exit_set
+{
+    size_t size;
+    enum xen_on_normal_exit contents[];
+} xen_on_normal_exit_set;
+
+/**
+ * Allocate a xen_on_normal_exit_set of the given size.
+ */
+extern xen_on_normal_exit_set *
+xen_on_normal_exit_set_alloc(size_t size);
+
+/**
+ * Free the given xen_on_normal_exit_set.  The given set must have been
+ * allocated by this library.
+ */
+extern void
+xen_on_normal_exit_set_free(xen_on_normal_exit_set *set);
+
+
+/**
+ * Return the name corresponding to the given code.  This string must
+ * not be modified or freed.
+ */
+extern const char *
+xen_on_normal_exit_to_string(enum xen_on_normal_exit val);
+
+
+/**
+ * Return the correct code for the given string, or set the session
+ * object to failure and return an undefined value if the given string does
+ * not match a known code.
+ */
+extern enum xen_on_normal_exit
+xen_on_normal_exit_from_string(xen_session *session, const char *str);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_pbd.h b/tools/libxen/include/xen/api/xen_pbd.h
new file mode 100644 (file)
index 0000000..224d2d4
--- /dev/null
@@ -0,0 +1,223 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_PBD_H
+#define XEN_PBD_H
+
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_host_decl.h>
+#include <xen/api/xen_pbd_decl.h>
+#include <xen/api/xen_sr_decl.h>
+#include <xen/api/xen_string_string_map.h>
+
+
+/*
+ * The PBD class.
+ * 
+ * The physical block devices through which hosts access SRs.
+ */
+
+
+/**
+ * Free the given xen_pbd.  The given handle must have been allocated
+ * by this library.
+ */
+extern void
+xen_pbd_free(xen_pbd pbd);
+
+
+typedef struct xen_pbd_set
+{
+    size_t size;
+    xen_pbd *contents[];
+} xen_pbd_set;
+
+/**
+ * Allocate a xen_pbd_set of the given size.
+ */
+extern xen_pbd_set *
+xen_pbd_set_alloc(size_t size);
+
+/**
+ * Free the given xen_pbd_set.  The given set must have been allocated
+ * by this library.
+ */
+extern void
+xen_pbd_set_free(xen_pbd_set *set);
+
+
+typedef struct xen_pbd_record
+{
+    xen_pbd handle;
+    char *uuid;
+    struct xen_host_record_opt *host;
+    struct xen_sr_record_opt *sr;
+    xen_string_string_map *device_config;
+    bool currently_attached;
+} xen_pbd_record;
+
+/**
+ * Allocate a xen_pbd_record.
+ */
+extern xen_pbd_record *
+xen_pbd_record_alloc(void);
+
+/**
+ * Free the given xen_pbd_record, and all referenced values.  The given
+ * record must have been allocated by this library.
+ */
+extern void
+xen_pbd_record_free(xen_pbd_record *record);
+
+
+typedef struct xen_pbd_record_opt
+{
+    bool is_record;
+    union
+    {
+        xen_pbd handle;
+        xen_pbd_record *record;
+    } u;
+} xen_pbd_record_opt;
+
+/**
+ * Allocate a xen_pbd_record_opt.
+ */
+extern xen_pbd_record_opt *
+xen_pbd_record_opt_alloc(void);
+
+/**
+ * Free the given xen_pbd_record_opt, and all referenced values.  The
+ * given record_opt must have been allocated by this library.
+ */
+extern void
+xen_pbd_record_opt_free(xen_pbd_record_opt *record_opt);
+
+
+typedef struct xen_pbd_record_set
+{
+    size_t size;
+    xen_pbd_record *contents[];
+} xen_pbd_record_set;
+
+/**
+ * Allocate a xen_pbd_record_set of the given size.
+ */
+extern xen_pbd_record_set *
+xen_pbd_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_pbd_record_set, and all referenced values.  The
+ * given set must have been allocated by this library.
+ */
+extern void
+xen_pbd_record_set_free(xen_pbd_record_set *set);
+
+
+
+typedef struct xen_pbd_record_opt_set
+{
+    size_t size;
+    xen_pbd_record_opt *contents[];
+} xen_pbd_record_opt_set;
+
+/**
+ * Allocate a xen_pbd_record_opt_set of the given size.
+ */
+extern xen_pbd_record_opt_set *
+xen_pbd_record_opt_set_alloc(size_t size);
+
+/**
+ * Free the given xen_pbd_record_opt_set, and all referenced values. 
+ * The given set must have been allocated by this library.
+ */
+extern void
+xen_pbd_record_opt_set_free(xen_pbd_record_opt_set *set);
+
+
+/**
+ * Get a record containing the current state of the given PBD.
+ */
+extern bool
+xen_pbd_get_record(xen_session *session, xen_pbd_record **result, xen_pbd pbd);
+
+
+/**
+ * Get a reference to the PBD instance with the specified UUID.
+ */
+extern bool
+xen_pbd_get_by_uuid(xen_session *session, xen_pbd *result, char *uuid);
+
+
+/**
+ * Create a new PBD instance, and return its handle.
+ */
+extern bool
+xen_pbd_create(xen_session *session, xen_pbd *result, xen_pbd_record *record);
+
+
+/**
+ * Destroy the specified PBD instance.
+ */
+extern bool
+xen_pbd_destroy(xen_session *session, xen_pbd pbd);
+
+
+/**
+ * Get the uuid field of the given PBD.
+ */
+extern bool
+xen_pbd_get_uuid(xen_session *session, char **result, xen_pbd pbd);
+
+
+/**
+ * Get the host field of the given PBD.
+ */
+extern bool
+xen_pbd_get_host(xen_session *session, xen_host *result, xen_pbd pbd);
+
+
+/**
+ * Get the SR field of the given PBD.
+ */
+extern bool
+xen_pbd_get_sr(xen_session *session, xen_sr *result, xen_pbd pbd);
+
+
+/**
+ * Get the device_config field of the given PBD.
+ */
+extern bool
+xen_pbd_get_device_config(xen_session *session, xen_string_string_map **result, xen_pbd pbd);
+
+
+/**
+ * Get the currently_attached field of the given PBD.
+ */
+extern bool
+xen_pbd_get_currently_attached(xen_session *session, bool *result, xen_pbd pbd);
+
+
+/**
+ * Return a list of all the PBDs known to the system.
+ */
+extern bool
+xen_pbd_get_all(xen_session *session, struct xen_pbd_set **result);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_pbd_decl.h b/tools/libxen/include/xen/api/xen_pbd_decl.h
new file mode 100644 (file)
index 0000000..c7e324e
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_PBD_DECL_H
+#define XEN_PBD_DECL_H
+
+typedef void *xen_pbd;
+
+struct xen_pbd_set;
+struct xen_pbd_record;
+struct xen_pbd_record_set;
+struct xen_pbd_record_opt;
+struct xen_pbd_record_opt_set;
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_pif.h b/tools/libxen/include/xen/api/xen_pif.h
new file mode 100644 (file)
index 0000000..d36efd0
--- /dev/null
@@ -0,0 +1,277 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_PIF_H
+#define XEN_PIF_H
+
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_host_decl.h>
+#include <xen/api/xen_network_decl.h>
+#include <xen/api/xen_pif_decl.h>
+#include <xen/api/xen_pif_metrics_decl.h>
+
+
+/*
+ * The PIF class.
+ * 
+ * A physical network interface (note separate VLANs are represented as
+ * several PIFs).
+ */
+
+
+/**
+ * Free the given xen_pif.  The given handle must have been allocated
+ * by this library.
+ */
+extern void
+xen_pif_free(xen_pif pif);
+
+
+typedef struct xen_pif_set
+{
+    size_t size;
+    xen_pif *contents[];
+} xen_pif_set;
+
+/**
+ * Allocate a xen_pif_set of the given size.
+ */
+extern xen_pif_set *
+xen_pif_set_alloc(size_t size);
+
+/**
+ * Free the given xen_pif_set.  The given set must have been allocated
+ * by this library.
+ */
+extern void
+xen_pif_set_free(xen_pif_set *set);
+
+
+typedef struct xen_pif_record
+{
+    xen_pif handle;
+    char *uuid;
+    char *device;
+    struct xen_network_record_opt *network;
+    struct xen_host_record_opt *host;
+    char *mac;
+    int64_t mtu;
+    int64_t vlan;
+    struct xen_pif_metrics_record_opt *metrics;
+} xen_pif_record;
+
+/**
+ * Allocate a xen_pif_record.
+ */
+extern xen_pif_record *
+xen_pif_record_alloc(void);
+
+/**
+ * Free the given xen_pif_record, and all referenced values.  The given
+ * record must have been allocated by this library.
+ */
+extern void
+xen_pif_record_free(xen_pif_record *record);
+
+
+typedef struct xen_pif_record_opt
+{
+    bool is_record;
+    union
+    {
+        xen_pif handle;
+        xen_pif_record *record;
+    } u;
+} xen_pif_record_opt;
+
+/**
+ * Allocate a xen_pif_record_opt.
+ */
+extern xen_pif_record_opt *
+xen_pif_record_opt_alloc(void);
+
+/**
+ * Free the given xen_pif_record_opt, and all referenced values.  The
+ * given record_opt must have been allocated by this library.
+ */
+extern void
+xen_pif_record_opt_free(xen_pif_record_opt *record_opt);
+
+
+typedef struct xen_pif_record_set
+{
+    size_t size;
+    xen_pif_record *contents[];
+} xen_pif_record_set;
+
+/**
+ * Allocate a xen_pif_record_set of the given size.
+ */
+extern xen_pif_record_set *
+xen_pif_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_pif_record_set, and all referenced values.  The
+ * given set must have been allocated by this library.
+ */
+extern void
+xen_pif_record_set_free(xen_pif_record_set *set);
+
+
+
+typedef struct xen_pif_record_opt_set
+{
+    size_t size;
+    xen_pif_record_opt *contents[];
+} xen_pif_record_opt_set;
+
+/**
+ * Allocate a xen_pif_record_opt_set of the given size.
+ */
+extern xen_pif_record_opt_set *
+xen_pif_record_opt_set_alloc(size_t size);
+
+/**
+ * Free the given xen_pif_record_opt_set, and all referenced values. 
+ * The given set must have been allocated by this library.
+ */
+extern void
+xen_pif_record_opt_set_free(xen_pif_record_opt_set *set);
+
+
+/**
+ * Get a record containing the current state of the given PIF.
+ */
+extern bool
+xen_pif_get_record(xen_session *session, xen_pif_record **result, xen_pif pif);
+
+
+/**
+ * Get a reference to the PIF instance with the specified UUID.
+ */
+extern bool
+xen_pif_get_by_uuid(xen_session *session, xen_pif *result, char *uuid);
+
+
+/**
+ * Get the uuid field of the given PIF.
+ */
+extern bool
+xen_pif_get_uuid(xen_session *session, char **result, xen_pif pif);
+
+
+/**
+ * Get the device field of the given PIF.
+ */
+extern bool
+xen_pif_get_device(xen_session *session, char **result, xen_pif pif);
+
+
+/**
+ * Get the network field of the given PIF.
+ */
+extern bool
+xen_pif_get_network(xen_session *session, xen_network *result, xen_pif pif);
+
+
+/**
+ * Get the host field of the given PIF.
+ */
+extern bool
+xen_pif_get_host(xen_session *session, xen_host *result, xen_pif pif);
+
+
+/**
+ * Get the MAC field of the given PIF.
+ */
+extern bool
+xen_pif_get_mac(xen_session *session, char **result, xen_pif pif);
+
+
+/**
+ * Get the MTU field of the given PIF.
+ */
+extern bool
+xen_pif_get_mtu(xen_session *session, int64_t *result, xen_pif pif);
+
+
+/**
+ * Get the VLAN field of the given PIF.
+ */
+extern bool
+xen_pif_get_vlan(xen_session *session, int64_t *result, xen_pif pif);
+
+
+/**
+ * Get the metrics field of the given PIF.
+ */
+extern bool
+xen_pif_get_metrics(xen_session *session, xen_pif_metrics *result, xen_pif pif);
+
+
+/**
+ * Set the device field of the given PIF.
+ */
+extern bool
+xen_pif_set_device(xen_session *session, xen_pif pif, char *device);
+
+
+/**
+ * Set the MAC field of the given PIF.
+ */
+extern bool
+xen_pif_set_mac(xen_session *session, xen_pif pif, char *mac);
+
+
+/**
+ * Set the MTU field of the given PIF.
+ */
+extern bool
+xen_pif_set_mtu(xen_session *session, xen_pif pif, int64_t mtu);
+
+
+/**
+ * Set the VLAN field of the given PIF.
+ */
+extern bool
+xen_pif_set_vlan(xen_session *session, xen_pif pif, int64_t vlan);
+
+
+/**
+ * Create a VLAN interface from an existing physical interface.
+ */
+extern bool
+xen_pif_create_vlan(xen_session *session, xen_pif *result, char *device, xen_network network, xen_host host, int64_t vlan);
+
+
+/**
+ * Destroy the interface (provided it is a synthetic interface like a
+ * VLAN; fail if it is a physical interface).
+ */
+extern bool
+xen_pif_destroy(xen_session *session, xen_pif self);
+
+
+/**
+ * Return a list of all the PIFs known to the system.
+ */
+extern bool
+xen_pif_get_all(xen_session *session, struct xen_pif_set **result);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_pif_decl.h b/tools/libxen/include/xen/api/xen_pif_decl.h
new file mode 100644 (file)
index 0000000..6d49bdb
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_PIF_DECL_H
+#define XEN_PIF_DECL_H
+
+typedef void *xen_pif;
+
+struct xen_pif_set;
+struct xen_pif_record;
+struct xen_pif_record_set;
+struct xen_pif_record_opt;
+struct xen_pif_record_opt_set;
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_pif_metrics.h b/tools/libxen/include/xen/api/xen_pif_metrics.h
new file mode 100644 (file)
index 0000000..06b9d26
--- /dev/null
@@ -0,0 +1,198 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_PIF_METRICS_H
+#define XEN_PIF_METRICS_H
+
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_pif_metrics_decl.h>
+
+
+/*
+ * The PIF_metrics class.
+ * 
+ * The metrics associated with a physical network interface.
+ */
+
+
+/**
+ * Free the given xen_pif_metrics.  The given handle must have been
+ * allocated by this library.
+ */
+extern void
+xen_pif_metrics_free(xen_pif_metrics pif_metrics);
+
+
+typedef struct xen_pif_metrics_set
+{
+    size_t size;
+    xen_pif_metrics *contents[];
+} xen_pif_metrics_set;
+
+/**
+ * Allocate a xen_pif_metrics_set of the given size.
+ */
+extern xen_pif_metrics_set *
+xen_pif_metrics_set_alloc(size_t size);
+
+/**
+ * Free the given xen_pif_metrics_set.  The given set must have been
+ * allocated by this library.
+ */
+extern void
+xen_pif_metrics_set_free(xen_pif_metrics_set *set);
+
+
+typedef struct xen_pif_metrics_record
+{
+    xen_pif_metrics handle;
+    char *uuid;
+    double io_read_kbs;
+    double io_write_kbs;
+    time_t last_updated;
+} xen_pif_metrics_record;
+
+/**
+ * Allocate a xen_pif_metrics_record.
+ */
+extern xen_pif_metrics_record *
+xen_pif_metrics_record_alloc(void);
+
+/**
+ * Free the given xen_pif_metrics_record, and all referenced values. 
+ * The given record must have been allocated by this library.
+ */
+extern void
+xen_pif_metrics_record_free(xen_pif_metrics_record *record);
+
+
+typedef struct xen_pif_metrics_record_opt
+{
+    bool is_record;
+    union
+    {
+        xen_pif_metrics handle;
+        xen_pif_metrics_record *record;
+    } u;
+} xen_pif_metrics_record_opt;
+
+/**
+ * Allocate a xen_pif_metrics_record_opt.
+ */
+extern xen_pif_metrics_record_opt *
+xen_pif_metrics_record_opt_alloc(void);
+
+/**
+ * Free the given xen_pif_metrics_record_opt, and all referenced
+ * values.  The given record_opt must have been allocated by this library.
+ */
+extern void
+xen_pif_metrics_record_opt_free(xen_pif_metrics_record_opt *record_opt);
+
+
+typedef struct xen_pif_metrics_record_set
+{
+    size_t size;
+    xen_pif_metrics_record *contents[];
+} xen_pif_metrics_record_set;
+
+/**
+ * Allocate a xen_pif_metrics_record_set of the given size.
+ */
+extern xen_pif_metrics_record_set *
+xen_pif_metrics_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_pif_metrics_record_set, and all referenced
+ * values.  The given set must have been allocated by this library.
+ */
+extern void
+xen_pif_metrics_record_set_free(xen_pif_metrics_record_set *set);
+
+
+
+typedef struct xen_pif_metrics_record_opt_set
+{
+    size_t size;
+    xen_pif_metrics_record_opt *contents[];
+} xen_pif_metrics_record_opt_set;
+
+/**
+ * Allocate a xen_pif_metrics_record_opt_set of the given size.
+ */
+extern xen_pif_metrics_record_opt_set *
+xen_pif_metrics_record_opt_set_alloc(size_t size);
+
+/**
+ * Free the given xen_pif_metrics_record_opt_set, and all referenced
+ * values.  The given set must have been allocated by this library.
+ */
+extern void
+xen_pif_metrics_record_opt_set_free(xen_pif_metrics_record_opt_set *set);
+
+
+/**
+ * Get a record containing the current state of the given PIF_metrics.
+ */
+extern bool
+xen_pif_metrics_get_record(xen_session *session, xen_pif_metrics_record **result, xen_pif_metrics pif_metrics);
+
+
+/**
+ * Get a reference to the PIF_metrics instance with the specified UUID.
+ */
+extern bool
+xen_pif_metrics_get_by_uuid(xen_session *session, xen_pif_metrics *result, char *uuid);
+
+
+/**
+ * Get the uuid field of the given PIF_metrics.
+ */
+extern bool
+xen_pif_metrics_get_uuid(xen_session *session, char **result, xen_pif_metrics pif_metrics);
+
+
+/**
+ * Get the io/read_kbs field of the given PIF_metrics.
+ */
+extern bool
+xen_pif_metrics_get_io_read_kbs(xen_session *session, double *result, xen_pif_metrics pif_metrics);
+
+
+/**
+ * Get the io/write_kbs field of the given PIF_metrics.
+ */
+extern bool
+xen_pif_metrics_get_io_write_kbs(xen_session *session, double *result, xen_pif_metrics pif_metrics);
+
+
+/**
+ * Get the last_updated field of the given PIF_metrics.
+ */
+extern bool
+xen_pif_metrics_get_last_updated(xen_session *session, time_t *result, xen_pif_metrics pif_metrics);
+
+
+/**
+ * Return a list of all the PIF_metrics instances known to the system.
+ */
+extern bool
+xen_pif_metrics_get_all(xen_session *session, struct xen_pif_metrics_set **result);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_pif_metrics_decl.h b/tools/libxen/include/xen/api/xen_pif_metrics_decl.h
new file mode 100644 (file)
index 0000000..f6ef2fd
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_PIF_METRICS_DECL_H
+#define XEN_PIF_METRICS_DECL_H
+
+typedef void *xen_pif_metrics;
+
+struct xen_pif_metrics_set;
+struct xen_pif_metrics_record;
+struct xen_pif_metrics_record_set;
+struct xen_pif_metrics_record_opt;
+struct xen_pif_metrics_record_opt_set;
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_sr.h b/tools/libxen/include/xen/api/xen_sr.h
new file mode 100644 (file)
index 0000000..08204a2
--- /dev/null
@@ -0,0 +1,277 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_SR_H
+#define XEN_SR_H
+
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_pbd_decl.h>
+#include <xen/api/xen_sr_decl.h>
+#include <xen/api/xen_string_set.h>
+#include <xen/api/xen_vdi_decl.h>
+
+
+/*
+ * The SR class.
+ * 
+ * A storage repository.
+ */
+
+
+/**
+ * Free the given xen_sr.  The given handle must have been allocated by
+ * this library.
+ */
+extern void
+xen_sr_free(xen_sr sr);
+
+
+typedef struct xen_sr_set
+{
+    size_t size;
+    xen_sr *contents[];
+} xen_sr_set;
+
+/**
+ * Allocate a xen_sr_set of the given size.
+ */
+extern xen_sr_set *
+xen_sr_set_alloc(size_t size);
+
+/**
+ * Free the given xen_sr_set.  The given set must have been allocated
+ * by this library.
+ */
+extern void
+xen_sr_set_free(xen_sr_set *set);
+
+
+typedef struct xen_sr_record
+{
+    xen_sr handle;
+    char *uuid;
+    char *name_label;
+    char *name_description;
+    struct xen_vdi_record_opt_set *vdis;
+    struct xen_pbd_record_opt_set *pbds;
+    int64_t virtual_allocation;
+    int64_t physical_utilisation;
+    int64_t physical_size;
+    char *type;
+    char *content_type;
+} xen_sr_record;
+
+/**
+ * Allocate a xen_sr_record.
+ */
+extern xen_sr_record *
+xen_sr_record_alloc(void);
+
+/**
+ * Free the given xen_sr_record, and all referenced values.  The given
+ * record must have been allocated by this library.
+ */
+extern void
+xen_sr_record_free(xen_sr_record *record);
+
+
+typedef struct xen_sr_record_opt
+{
+    bool is_record;
+    union
+    {
+        xen_sr handle;
+        xen_sr_record *record;
+    } u;
+} xen_sr_record_opt;
+
+/**
+ * Allocate a xen_sr_record_opt.
+ */
+extern xen_sr_record_opt *
+xen_sr_record_opt_alloc(void);
+
+/**
+ * Free the given xen_sr_record_opt, and all referenced values.  The
+ * given record_opt must have been allocated by this library.
+ */
+extern void
+xen_sr_record_opt_free(xen_sr_record_opt *record_opt);
+
+
+typedef struct xen_sr_record_set
+{
+    size_t size;
+    xen_sr_record *contents[];
+} xen_sr_record_set;
+
+/**
+ * Allocate a xen_sr_record_set of the given size.
+ */
+extern xen_sr_record_set *
+xen_sr_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_sr_record_set, and all referenced values.  The
+ * given set must have been allocated by this library.
+ */
+extern void
+xen_sr_record_set_free(xen_sr_record_set *set);
+
+
+
+typedef struct xen_sr_record_opt_set
+{
+    size_t size;
+    xen_sr_record_opt *contents[];
+} xen_sr_record_opt_set;
+
+/**
+ * Allocate a xen_sr_record_opt_set of the given size.
+ */
+extern xen_sr_record_opt_set *
+xen_sr_record_opt_set_alloc(size_t size);
+
+/**
+ * Free the given xen_sr_record_opt_set, and all referenced values. 
+ * The given set must have been allocated by this library.
+ */
+extern void
+xen_sr_record_opt_set_free(xen_sr_record_opt_set *set);
+
+
+/**
+ * Get a record containing the current state of the given SR.
+ */
+extern bool
+xen_sr_get_record(xen_session *session, xen_sr_record **result, xen_sr sr);
+
+
+/**
+ * Get a reference to the SR instance with the specified UUID.
+ */
+extern bool
+xen_sr_get_by_uuid(xen_session *session, xen_sr *result, char *uuid);
+
+
+/**
+ * Get all the SR instances with the given label.
+ */
+extern bool
+xen_sr_get_by_name_label(xen_session *session, struct xen_sr_set **result, char *label);
+
+
+/**
+ * Get the uuid field of the given SR.
+ */
+extern bool
+xen_sr_get_uuid(xen_session *session, char **result, xen_sr sr);
+
+
+/**
+ * Get the name/label field of the given SR.
+ */
+extern bool
+xen_sr_get_name_label(xen_session *session, char **result, xen_sr sr);
+
+
+/**
+ * Get the name/description field of the given SR.
+ */
+extern bool
+xen_sr_get_name_description(xen_session *session, char **result, xen_sr sr);
+
+
+/**
+ * Get the VDIs field of the given SR.
+ */
+extern bool
+xen_sr_get_vdis(xen_session *session, struct xen_vdi_set **result, xen_sr sr);
+
+
+/**
+ * Get the PBDs field of the given SR.
+ */
+extern bool
+xen_sr_get_pbds(xen_session *session, struct xen_pbd_set **result, xen_sr sr);
+
+
+/**
+ * Get the virtual_allocation field of the given SR.
+ */
+extern bool
+xen_sr_get_virtual_allocation(xen_session *session, int64_t *result, xen_sr sr);
+
+
+/**
+ * Get the physical_utilisation field of the given SR.
+ */
+extern bool
+xen_sr_get_physical_utilisation(xen_session *session, int64_t *result, xen_sr sr);
+
+
+/**
+ * Get the physical_size field of the given SR.
+ */
+extern bool
+xen_sr_get_physical_size(xen_session *session, int64_t *result, xen_sr sr);
+
+
+/**
+ * Get the type field of the given SR.
+ */
+extern bool
+xen_sr_get_type(xen_session *session, char **result, xen_sr sr);
+
+
+/**
+ * Get the content_type field of the given SR.
+ */
+extern bool
+xen_sr_get_content_type(xen_session *session, char **result, xen_sr sr);
+
+
+/**
+ * Set the name/label field of the given SR.
+ */
+extern bool
+xen_sr_set_name_label(xen_session *session, xen_sr sr, char *label);
+
+
+/**
+ * Set the name/description field of the given SR.
+ */
+extern bool
+xen_sr_set_name_description(xen_session *session, xen_sr sr, char *description);
+
+
+/**
+ * Return a set of all the SR types supported by the system.
+ */
+extern bool
+xen_sr_get_supported_types(xen_session *session, struct xen_string_set **result);
+
+
+/**
+ * Return a list of all the SRs known to the system.
+ */
+extern bool
+xen_sr_get_all(xen_session *session, struct xen_sr_set **result);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_sr_decl.h b/tools/libxen/include/xen/api/xen_sr_decl.h
new file mode 100644 (file)
index 0000000..ae7d4f6
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_SR_DECL_H
+#define XEN_SR_DECL_H
+
+typedef void *xen_sr;
+
+struct xen_sr_set;
+struct xen_sr_record;
+struct xen_sr_record_set;
+struct xen_sr_record_opt;
+struct xen_sr_record_opt_set;
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_string_set.h b/tools/libxen/include/xen/api/xen_string_set.h
new file mode 100644 (file)
index 0000000..a14af94
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_STRING_SET_H
+#define XEN_STRING_SET_H
+
+
+#include "xen_common.h"
+
+
+typedef struct xen_string_set
+{
+    size_t size;
+    char *contents[];
+} xen_string_set;
+
+
+/**
+ * Allocate a xen_string_set of the given size.
+ */
+extern xen_string_set *
+xen_string_set_alloc(size_t size);
+
+/**
+ * Free the given xen_string_set.  The given set must have been allocated
+ * by this library.
+ */
+extern void
+xen_string_set_free(xen_string_set *set);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_string_string_map.h b/tools/libxen/include/xen/api/xen_string_string_map.h
new file mode 100644 (file)
index 0000000..d800442
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_STRING_STRING_MAP_H
+#define XEN_STRING_STRING_MAP_H
+
+
+#include <xen/api/xen_common.h>
+
+
+typedef struct xen_string_string_map_contents
+{
+  char *key;
+  char *val;
+} xen_string_string_map_contents;
+
+
+typedef struct xen_string_string_map
+{
+    size_t size;
+    xen_string_string_map_contents contents[];
+} xen_string_string_map;
+
+/**
+ * Allocate a xen_string_string_map of the given size.
+ */
+extern xen_string_string_map *
+xen_string_string_map_alloc(size_t size);
+
+/**
+ * Free the given xen_string_string_map, and all referenced values. 
+ * The given map must have been allocated by this library.
+ */
+extern void
+xen_string_string_map_free(xen_string_string_map *map);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_user.h b/tools/libxen/include/xen/api/xen_user.h
new file mode 100644 (file)
index 0000000..a6d9dd9
--- /dev/null
@@ -0,0 +1,204 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_USER_H
+#define XEN_USER_H
+
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_user_decl.h>
+
+
+/*
+ * The user class.
+ * 
+ * A user of the system.
+ */
+
+
+/**
+ * Free the given xen_user.  The given handle must have been allocated
+ * by this library.
+ */
+extern void
+xen_user_free(xen_user user);
+
+
+typedef struct xen_user_set
+{
+    size_t size;
+    xen_user *contents[];
+} xen_user_set;
+
+/**
+ * Allocate a xen_user_set of the given size.
+ */
+extern xen_user_set *
+xen_user_set_alloc(size_t size);
+
+/**
+ * Free the given xen_user_set.  The given set must have been allocated
+ * by this library.
+ */
+extern void
+xen_user_set_free(xen_user_set *set);
+
+
+typedef struct xen_user_record
+{
+    xen_user handle;
+    char *uuid;
+    char *short_name;
+    char *fullname;
+} xen_user_record;
+
+/**
+ * Allocate a xen_user_record.
+ */
+extern xen_user_record *
+xen_user_record_alloc(void);
+
+/**
+ * Free the given xen_user_record, and all referenced values.  The
+ * given record must have been allocated by this library.
+ */
+extern void
+xen_user_record_free(xen_user_record *record);
+
+
+typedef struct xen_user_record_opt
+{
+    bool is_record;
+    union
+    {
+        xen_user handle;
+        xen_user_record *record;
+    } u;
+} xen_user_record_opt;
+
+/**
+ * Allocate a xen_user_record_opt.
+ */
+extern xen_user_record_opt *
+xen_user_record_opt_alloc(void);
+
+/**
+ * Free the given xen_user_record_opt, and all referenced values.  The
+ * given record_opt must have been allocated by this library.
+ */
+extern void
+xen_user_record_opt_free(xen_user_record_opt *record_opt);
+
+
+typedef struct xen_user_record_set
+{
+    size_t size;
+    xen_user_record *contents[];
+} xen_user_record_set;
+
+/**
+ * Allocate a xen_user_record_set of the given size.
+ */
+extern xen_user_record_set *
+xen_user_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_user_record_set, and all referenced values.  The
+ * given set must have been allocated by this library.
+ */
+extern void
+xen_user_record_set_free(xen_user_record_set *set);
+
+
+
+typedef struct xen_user_record_opt_set
+{
+    size_t size;
+    xen_user_record_opt *contents[];
+} xen_user_record_opt_set;
+
+/**
+ * Allocate a xen_user_record_opt_set of the given size.
+ */
+extern xen_user_record_opt_set *
+xen_user_record_opt_set_alloc(size_t size);
+
+/**
+ * Free the given xen_user_record_opt_set, and all referenced values. 
+ * The given set must have been allocated by this library.
+ */
+extern void
+xen_user_record_opt_set_free(xen_user_record_opt_set *set);
+
+
+/**
+ * Get a record containing the current state of the given user.
+ */
+extern bool
+xen_user_get_record(xen_session *session, xen_user_record **result, xen_user user);
+
+
+/**
+ * Get a reference to the user instance with the specified UUID.
+ */
+extern bool
+xen_user_get_by_uuid(xen_session *session, xen_user *result, char *uuid);
+
+
+/**
+ * Create a new user instance, and return its handle.
+ */
+extern bool
+xen_user_create(xen_session *session, xen_user *result, xen_user_record *record);
+
+
+/**
+ * Destroy the specified user instance.
+ */
+extern bool
+xen_user_destroy(xen_session *session, xen_user user);
+
+
+/**
+ * Get the uuid field of the given user.
+ */
+extern bool
+xen_user_get_uuid(xen_session *session, char **result, xen_user user);
+
+
+/**
+ * Get the short_name field of the given user.
+ */
+extern bool
+xen_user_get_short_name(xen_session *session, char **result, xen_user user);
+
+
+/**
+ * Get the fullname field of the given user.
+ */
+extern bool
+xen_user_get_fullname(xen_session *session, char **result, xen_user user);
+
+
+/**
+ * Set the fullname field of the given user.
+ */
+extern bool
+xen_user_set_fullname(xen_session *session, xen_user user, char *fullname);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_user_decl.h b/tools/libxen/include/xen/api/xen_user_decl.h
new file mode 100644 (file)
index 0000000..723a8bf
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_USER_DECL_H
+#define XEN_USER_DECL_H
+
+typedef void *xen_user;
+
+struct xen_user_set;
+struct xen_user_record;
+struct xen_user_record_set;
+struct xen_user_record_opt;
+struct xen_user_record_opt_set;
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_vbd.h b/tools/libxen/include/xen/api/xen_vbd.h
new file mode 100644 (file)
index 0000000..9806c5e
--- /dev/null
@@ -0,0 +1,390 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_VBD_H
+#define XEN_VBD_H
+
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_string_set.h>
+#include <xen/api/xen_string_string_map.h>
+#include <xen/api/xen_vbd_decl.h>
+#include <xen/api/xen_vbd_metrics_decl.h>
+#include <xen/api/xen_vbd_mode.h>
+#include <xen/api/xen_vbd_type.h>
+#include <xen/api/xen_vdi_decl.h>
+#include <xen/api/xen_vm_decl.h>
+
+
+/*
+ * The VBD class.
+ * 
+ * A virtual block device.
+ */
+
+
+/**
+ * Free the given xen_vbd.  The given handle must have been allocated
+ * by this library.
+ */
+extern void
+xen_vbd_free(xen_vbd vbd);
+
+
+typedef struct xen_vbd_set
+{
+    size_t size;
+    xen_vbd *contents[];
+} xen_vbd_set;
+
+/**
+ * Allocate a xen_vbd_set of the given size.
+ */
+extern xen_vbd_set *
+xen_vbd_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vbd_set.  The given set must have been allocated
+ * by this library.
+ */
+extern void
+xen_vbd_set_free(xen_vbd_set *set);
+
+
+typedef struct xen_vbd_record
+{
+    xen_vbd handle;
+    char *uuid;
+    struct xen_vm_record_opt *vm;
+    struct xen_vdi_record_opt *vdi;
+    char *device;
+    bool bootable;
+    enum xen_vbd_mode mode;
+    enum xen_vbd_type type;
+    bool currently_attached;
+    int64_t status_code;
+    char *status_detail;
+    xen_string_string_map *runtime_properties;
+    char *qos_algorithm_type;
+    xen_string_string_map *qos_algorithm_params;
+    struct xen_string_set *qos_supported_algorithms;
+    struct xen_vbd_metrics_record_opt *metrics;
+} xen_vbd_record;
+
+/**
+ * Allocate a xen_vbd_record.
+ */
+extern xen_vbd_record *
+xen_vbd_record_alloc(void);
+
+/**
+ * Free the given xen_vbd_record, and all referenced values.  The given
+ * record must have been allocated by this library.
+ */
+extern void
+xen_vbd_record_free(xen_vbd_record *record);
+
+
+typedef struct xen_vbd_record_opt
+{
+    bool is_record;
+    union
+    {
+        xen_vbd handle;
+        xen_vbd_record *record;
+    } u;
+} xen_vbd_record_opt;
+
+/**
+ * Allocate a xen_vbd_record_opt.
+ */
+extern xen_vbd_record_opt *
+xen_vbd_record_opt_alloc(void);
+
+/**
+ * Free the given xen_vbd_record_opt, and all referenced values.  The
+ * given record_opt must have been allocated by this library.
+ */
+extern void
+xen_vbd_record_opt_free(xen_vbd_record_opt *record_opt);
+
+
+typedef struct xen_vbd_record_set
+{
+    size_t size;
+    xen_vbd_record *contents[];
+} xen_vbd_record_set;
+
+/**
+ * Allocate a xen_vbd_record_set of the given size.
+ */
+extern xen_vbd_record_set *
+xen_vbd_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vbd_record_set, and all referenced values.  The
+ * given set must have been allocated by this library.
+ */
+extern void
+xen_vbd_record_set_free(xen_vbd_record_set *set);
+
+
+
+typedef struct xen_vbd_record_opt_set
+{
+    size_t size;
+    xen_vbd_record_opt *contents[];
+} xen_vbd_record_opt_set;
+
+/**
+ * Allocate a xen_vbd_record_opt_set of the given size.
+ */
+extern xen_vbd_record_opt_set *
+xen_vbd_record_opt_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vbd_record_opt_set, and all referenced values. 
+ * The given set must have been allocated by this library.
+ */
+extern void
+xen_vbd_record_opt_set_free(xen_vbd_record_opt_set *set);
+
+
+/**
+ * Get a record containing the current state of the given VBD.
+ */
+extern bool
+xen_vbd_get_record(xen_session *session, xen_vbd_record **result, xen_vbd vbd);
+
+
+/**
+ * Get a reference to the VBD instance with the specified UUID.
+ */
+extern bool
+xen_vbd_get_by_uuid(xen_session *session, xen_vbd *result, char *uuid);
+
+
+/**
+ * Create a new VBD instance, and return its handle.
+ */
+extern bool
+xen_vbd_create(xen_session *session, xen_vbd *result, xen_vbd_record *record);
+
+
+/**
+ * Destroy the specified VBD instance.
+ */
+extern bool
+xen_vbd_destroy(xen_session *session, xen_vbd vbd);
+
+
+/**
+ * Get the uuid field of the given VBD.
+ */
+extern bool
+xen_vbd_get_uuid(xen_session *session, char **result, xen_vbd vbd);
+
+
+/**
+ * Get the VM field of the given VBD.
+ */
+extern bool
+xen_vbd_get_vm(xen_session *session, xen_vm *result, xen_vbd vbd);
+
+
+/**
+ * Get the VDI field of the given VBD.
+ */
+extern bool
+xen_vbd_get_vdi(xen_session *session, xen_vdi *result, xen_vbd vbd);
+
+
+/**
+ * Get the device field of the given VBD.
+ */
+extern bool
+xen_vbd_get_device(xen_session *session, char **result, xen_vbd vbd);
+
+
+/**
+ * Get the bootable field of the given VBD.
+ */
+extern bool
+xen_vbd_get_bootable(xen_session *session, bool *result, xen_vbd vbd);
+
+
+/**
+ * Get the mode field of the given VBD.
+ */
+extern bool
+xen_vbd_get_mode(xen_session *session, enum xen_vbd_mode *result, xen_vbd vbd);
+
+
+/**
+ * Get the type field of the given VBD.
+ */
+extern bool
+xen_vbd_get_type(xen_session *session, enum xen_vbd_type *result, xen_vbd vbd);
+
+
+/**
+ * Get the currently_attached field of the given VBD.
+ */
+extern bool
+xen_vbd_get_currently_attached(xen_session *session, bool *result, xen_vbd vbd);
+
+
+/**
+ * Get the status_code field of the given VBD.
+ */
+extern bool
+xen_vbd_get_status_code(xen_session *session, int64_t *result, xen_vbd vbd);
+
+
+/**
+ * Get the status_detail field of the given VBD.
+ */
+extern bool
+xen_vbd_get_status_detail(xen_session *session, char **result, xen_vbd vbd);
+
+
+/**
+ * Get the runtime_properties field of the given VBD.
+ */
+extern bool
+xen_vbd_get_runtime_properties(xen_session *session, xen_string_string_map **result, xen_vbd vbd);
+
+
+/**
+ * Get the qos/algorithm_type field of the given VBD.
+ */
+extern bool
+xen_vbd_get_qos_algorithm_type(xen_session *session, char **result, xen_vbd vbd);
+
+
+/**
+ * Get the qos/algorithm_params field of the given VBD.
+ */
+extern bool
+xen_vbd_get_qos_algorithm_params(xen_session *session, xen_string_string_map **result, xen_vbd vbd);
+
+
+/**
+ * Get the qos/supported_algorithms field of the given VBD.
+ */
+extern bool
+xen_vbd_get_qos_supported_algorithms(xen_session *session, struct xen_string_set **result, xen_vbd vbd);
+
+
+/**
+ * Get the metrics field of the given VBD.
+ */
+extern bool
+xen_vbd_get_metrics(xen_session *session, xen_vbd_metrics *result, xen_vbd vbd);
+
+
+/**
+ * Set the device field of the given VBD.
+ */
+extern bool
+xen_vbd_set_device(xen_session *session, xen_vbd vbd, char *device);
+
+
+/**
+ * Set the bootable field of the given VBD.
+ */
+extern bool
+xen_vbd_set_bootable(xen_session *session, xen_vbd vbd, bool bootable);
+
+
+/**
+ * Set the mode field of the given VBD.
+ */
+extern bool
+xen_vbd_set_mode(xen_session *session, xen_vbd vbd, enum xen_vbd_mode mode);
+
+
+/**
+ * Set the type field of the given VBD.
+ */
+extern bool
+xen_vbd_set_type(xen_session *session, xen_vbd vbd, enum xen_vbd_type type);
+
+
+/**
+ * Set the qos/algorithm_type field of the given VBD.
+ */
+extern bool
+xen_vbd_set_qos_algorithm_type(xen_session *session, xen_vbd vbd, char *algorithm_type);
+
+
+/**
+ * Set the qos/algorithm_params field of the given VBD.
+ */
+extern bool
+xen_vbd_set_qos_algorithm_params(xen_session *session, xen_vbd vbd, xen_string_string_map *algorithm_params);
+
+
+/**
+ * Add the given key-value pair to the qos/algorithm_params field of
+ * the given VBD.
+ */
+extern bool
+xen_vbd_add_to_qos_algorithm_params(xen_session *session, xen_vbd vbd, char *key, char *value);
+
+
+/**
+ * Remove the given key and its corresponding value from the
+ * qos/algorithm_params field of the given VBD.  If the key is not in that
+ * Map, then do nothing.
+ */
+extern bool
+xen_vbd_remove_from_qos_algorithm_params(xen_session *session, xen_vbd vbd, char *key);
+
+
+/**
+ * Change the media in the device for CDROM-like devices only. For
+ * other devices, detach the VBD and attach a new one.
+ */
+extern bool
+xen_vbd_media_change(xen_session *session, xen_vbd vbd, xen_vdi vdi);
+
+
+/**
+ * Hotplug the specified VBD, dynamically attaching it to the running
+ * VM.
+ */
+extern bool
+xen_vbd_plug(xen_session *session, xen_vbd self);
+
+
+/**
+ * Hot-unplug the specified VBD, dynamically unattaching it from the
+ * running VM.
+ */
+extern bool
+xen_vbd_unplug(xen_session *session, xen_vbd self);
+
+
+/**
+ * Return a list of all the VBDs known to the system.
+ */
+extern bool
+xen_vbd_get_all(xen_session *session, struct xen_vbd_set **result);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_vbd_decl.h b/tools/libxen/include/xen/api/xen_vbd_decl.h
new file mode 100644 (file)
index 0000000..018af3b
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_VBD_DECL_H
+#define XEN_VBD_DECL_H
+
+typedef void *xen_vbd;
+
+struct xen_vbd_set;
+struct xen_vbd_record;
+struct xen_vbd_record_set;
+struct xen_vbd_record_opt;
+struct xen_vbd_record_opt_set;
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_vbd_metrics.h b/tools/libxen/include/xen/api/xen_vbd_metrics.h
new file mode 100644 (file)
index 0000000..1cb1a2b
--- /dev/null
@@ -0,0 +1,198 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_VBD_METRICS_H
+#define XEN_VBD_METRICS_H
+
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_vbd_metrics_decl.h>
+
+
+/*
+ * The VBD_metrics class.
+ * 
+ * The metrics associated with a virtual block device.
+ */
+
+
+/**
+ * Free the given xen_vbd_metrics.  The given handle must have been
+ * allocated by this library.
+ */
+extern void
+xen_vbd_metrics_free(xen_vbd_metrics vbd_metrics);
+
+
+typedef struct xen_vbd_metrics_set
+{
+    size_t size;
+    xen_vbd_metrics *contents[];
+} xen_vbd_metrics_set;
+
+/**
+ * Allocate a xen_vbd_metrics_set of the given size.
+ */
+extern xen_vbd_metrics_set *
+xen_vbd_metrics_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vbd_metrics_set.  The given set must have been
+ * allocated by this library.
+ */
+extern void
+xen_vbd_metrics_set_free(xen_vbd_metrics_set *set);
+
+
+typedef struct xen_vbd_metrics_record
+{
+    xen_vbd_metrics handle;
+    char *uuid;
+    double io_read_kbs;
+    double io_write_kbs;
+    time_t last_updated;
+} xen_vbd_metrics_record;
+
+/**
+ * Allocate a xen_vbd_metrics_record.
+ */
+extern xen_vbd_metrics_record *
+xen_vbd_metrics_record_alloc(void);
+
+/**
+ * Free the given xen_vbd_metrics_record, and all referenced values. 
+ * The given record must have been allocated by this library.
+ */
+extern void
+xen_vbd_metrics_record_free(xen_vbd_metrics_record *record);
+
+
+typedef struct xen_vbd_metrics_record_opt
+{
+    bool is_record;
+    union
+    {
+        xen_vbd_metrics handle;
+        xen_vbd_metrics_record *record;
+    } u;
+} xen_vbd_metrics_record_opt;
+
+/**
+ * Allocate a xen_vbd_metrics_record_opt.
+ */
+extern xen_vbd_metrics_record_opt *
+xen_vbd_metrics_record_opt_alloc(void);
+
+/**
+ * Free the given xen_vbd_metrics_record_opt, and all referenced
+ * values.  The given record_opt must have been allocated by this library.
+ */
+extern void
+xen_vbd_metrics_record_opt_free(xen_vbd_metrics_record_opt *record_opt);
+
+
+typedef struct xen_vbd_metrics_record_set
+{
+    size_t size;
+    xen_vbd_metrics_record *contents[];
+} xen_vbd_metrics_record_set;
+
+/**
+ * Allocate a xen_vbd_metrics_record_set of the given size.
+ */
+extern xen_vbd_metrics_record_set *
+xen_vbd_metrics_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vbd_metrics_record_set, and all referenced
+ * values.  The given set must have been allocated by this library.
+ */
+extern void
+xen_vbd_metrics_record_set_free(xen_vbd_metrics_record_set *set);
+
+
+
+typedef struct xen_vbd_metrics_record_opt_set
+{
+    size_t size;
+    xen_vbd_metrics_record_opt *contents[];
+} xen_vbd_metrics_record_opt_set;
+
+/**
+ * Allocate a xen_vbd_metrics_record_opt_set of the given size.
+ */
+extern xen_vbd_metrics_record_opt_set *
+xen_vbd_metrics_record_opt_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vbd_metrics_record_opt_set, and all referenced
+ * values.  The given set must have been allocated by this library.
+ */
+extern void
+xen_vbd_metrics_record_opt_set_free(xen_vbd_metrics_record_opt_set *set);
+
+
+/**
+ * Get a record containing the current state of the given VBD_metrics.
+ */
+extern bool
+xen_vbd_metrics_get_record(xen_session *session, xen_vbd_metrics_record **result, xen_vbd_metrics vbd_metrics);
+
+
+/**
+ * Get a reference to the VBD_metrics instance with the specified UUID.
+ */
+extern bool
+xen_vbd_metrics_get_by_uuid(xen_session *session, xen_vbd_metrics *result, char *uuid);
+
+
+/**
+ * Get the uuid field of the given VBD_metrics.
+ */
+extern bool
+xen_vbd_metrics_get_uuid(xen_session *session, char **result, xen_vbd_metrics vbd_metrics);
+
+
+/**
+ * Get the io/read_kbs field of the given VBD_metrics.
+ */
+extern bool
+xen_vbd_metrics_get_io_read_kbs(xen_session *session, double *result, xen_vbd_metrics vbd_metrics);
+
+
+/**
+ * Get the io/write_kbs field of the given VBD_metrics.
+ */
+extern bool
+xen_vbd_metrics_get_io_write_kbs(xen_session *session, double *result, xen_vbd_metrics vbd_metrics);
+
+
+/**
+ * Get the last_updated field of the given VBD_metrics.
+ */
+extern bool
+xen_vbd_metrics_get_last_updated(xen_session *session, time_t *result, xen_vbd_metrics vbd_metrics);
+
+
+/**
+ * Return a list of all the VBD_metrics instances known to the system.
+ */
+extern bool
+xen_vbd_metrics_get_all(xen_session *session, struct xen_vbd_metrics_set **result);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_vbd_metrics_decl.h b/tools/libxen/include/xen/api/xen_vbd_metrics_decl.h
new file mode 100644 (file)
index 0000000..501aa8f
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_VBD_METRICS_DECL_H
+#define XEN_VBD_METRICS_DECL_H
+
+typedef void *xen_vbd_metrics;
+
+struct xen_vbd_metrics_set;
+struct xen_vbd_metrics_record;
+struct xen_vbd_metrics_record_set;
+struct xen_vbd_metrics_record_opt;
+struct xen_vbd_metrics_record_opt_set;
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_vbd_mode.h b/tools/libxen/include/xen/api/xen_vbd_mode.h
new file mode 100644 (file)
index 0000000..8cab27e
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_VBD_MODE_H
+#define XEN_VBD_MODE_H
+
+
+#include <xen/api/xen_common.h>
+
+
+enum xen_vbd_mode
+{
+    /**
+     * disk is mounted read-only
+     */
+    XEN_VBD_MODE_RO,
+
+    /**
+     * disk is mounted read-write
+     */
+    XEN_VBD_MODE_RW
+};
+
+
+typedef struct xen_vbd_mode_set
+{
+    size_t size;
+    enum xen_vbd_mode contents[];
+} xen_vbd_mode_set;
+
+/**
+ * Allocate a xen_vbd_mode_set of the given size.
+ */
+extern xen_vbd_mode_set *
+xen_vbd_mode_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vbd_mode_set.  The given set must have been
+ * allocated by this library.
+ */
+extern void
+xen_vbd_mode_set_free(xen_vbd_mode_set *set);
+
+
+/**
+ * Return the name corresponding to the given code.  This string must
+ * not be modified or freed.
+ */
+extern const char *
+xen_vbd_mode_to_string(enum xen_vbd_mode val);
+
+
+/**
+ * Return the correct code for the given string, or set the session
+ * object to failure and return an undefined value if the given string does
+ * not match a known code.
+ */
+extern enum xen_vbd_mode
+xen_vbd_mode_from_string(xen_session *session, const char *str);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_vbd_type.h b/tools/libxen/include/xen/api/xen_vbd_type.h
new file mode 100644 (file)
index 0000000..d19aef8
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_VBD_TYPE_H
+#define XEN_VBD_TYPE_H
+
+
+#include <xen/api/xen_common.h>
+
+
+enum xen_vbd_type
+{
+    /**
+     * VBD will appear to guest as CD
+     */
+    XEN_VBD_TYPE_CD,
+
+    /**
+     * VBD will appear to guest as disk
+     */
+    XEN_VBD_TYPE_DISK
+};
+
+
+typedef struct xen_vbd_type_set
+{
+    size_t size;
+    enum xen_vbd_type contents[];
+} xen_vbd_type_set;
+
+/**
+ * Allocate a xen_vbd_type_set of the given size.
+ */
+extern xen_vbd_type_set *
+xen_vbd_type_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vbd_type_set.  The given set must have been
+ * allocated by this library.
+ */
+extern void
+xen_vbd_type_set_free(xen_vbd_type_set *set);
+
+
+/**
+ * Return the name corresponding to the given code.  This string must
+ * not be modified or freed.
+ */
+extern const char *
+xen_vbd_type_to_string(enum xen_vbd_type val);
+
+
+/**
+ * Return the correct code for the given string, or set the session
+ * object to failure and return an undefined value if the given string does
+ * not match a known code.
+ */
+extern enum xen_vbd_type
+xen_vbd_type_from_string(xen_session *session, const char *str);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_vdi.h b/tools/libxen/include/xen/api/xen_vdi.h
new file mode 100644 (file)
index 0000000..c40dcfc
--- /dev/null
@@ -0,0 +1,347 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_VDI_H
+#define XEN_VDI_H
+
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_crashdump_decl.h>
+#include <xen/api/xen_sr_decl.h>
+#include <xen/api/xen_string_string_map.h>
+#include <xen/api/xen_vbd_decl.h>
+#include <xen/api/xen_vdi_decl.h>
+#include <xen/api/xen_vdi_type.h>
+
+
+/*
+ * The VDI class.
+ * 
+ * A virtual disk image.
+ */
+
+
+/**
+ * Free the given xen_vdi.  The given handle must have been allocated
+ * by this library.
+ */
+extern void
+xen_vdi_free(xen_vdi vdi);
+
+
+typedef struct xen_vdi_set
+{
+    size_t size;
+    xen_vdi *contents[];
+} xen_vdi_set;
+
+/**
+ * Allocate a xen_vdi_set of the given size.
+ */
+extern xen_vdi_set *
+xen_vdi_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vdi_set.  The given set must have been allocated
+ * by this library.
+ */
+extern void
+xen_vdi_set_free(xen_vdi_set *set);
+
+
+typedef struct xen_vdi_record
+{
+    xen_vdi handle;
+    char *uuid;
+    char *name_label;
+    char *name_description;
+    struct xen_sr_record_opt *sr;
+    struct xen_vbd_record_opt_set *vbds;
+    struct xen_crashdump_record_opt_set *crash_dumps;
+    int64_t virtual_size;
+    int64_t physical_utilisation;
+    enum xen_vdi_type type;
+    bool sharable;
+    bool read_only;
+    xen_string_string_map *other_config;
+} xen_vdi_record;
+
+/**
+ * Allocate a xen_vdi_record.
+ */
+extern xen_vdi_record *
+xen_vdi_record_alloc(void);
+
+/**
+ * Free the given xen_vdi_record, and all referenced values.  The given
+ * record must have been allocated by this library.
+ */
+extern void
+xen_vdi_record_free(xen_vdi_record *record);
+
+
+typedef struct xen_vdi_record_opt
+{
+    bool is_record;
+    union
+    {
+        xen_vdi handle;
+        xen_vdi_record *record;
+    } u;
+} xen_vdi_record_opt;
+
+/**
+ * Allocate a xen_vdi_record_opt.
+ */
+extern xen_vdi_record_opt *
+xen_vdi_record_opt_alloc(void);
+
+/**
+ * Free the given xen_vdi_record_opt, and all referenced values.  The
+ * given record_opt must have been allocated by this library.
+ */
+extern void
+xen_vdi_record_opt_free(xen_vdi_record_opt *record_opt);
+
+
+typedef struct xen_vdi_record_set
+{
+    size_t size;
+    xen_vdi_record *contents[];
+} xen_vdi_record_set;
+
+/**
+ * Allocate a xen_vdi_record_set of the given size.
+ */
+extern xen_vdi_record_set *
+xen_vdi_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vdi_record_set, and all referenced values.  The
+ * given set must have been allocated by this library.
+ */
+extern void
+xen_vdi_record_set_free(xen_vdi_record_set *set);
+
+
+
+typedef struct xen_vdi_record_opt_set
+{
+    size_t size;
+    xen_vdi_record_opt *contents[];
+} xen_vdi_record_opt_set;
+
+/**
+ * Allocate a xen_vdi_record_opt_set of the given size.
+ */
+extern xen_vdi_record_opt_set *
+xen_vdi_record_opt_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vdi_record_opt_set, and all referenced values. 
+ * The given set must have been allocated by this library.
+ */
+extern void
+xen_vdi_record_opt_set_free(xen_vdi_record_opt_set *set);
+
+
+/**
+ * Get a record containing the current state of the given VDI.
+ */
+extern bool
+xen_vdi_get_record(xen_session *session, xen_vdi_record **result, xen_vdi vdi);
+
+
+/**
+ * Get a reference to the VDI instance with the specified UUID.
+ */
+extern bool
+xen_vdi_get_by_uuid(xen_session *session, xen_vdi *result, char *uuid);
+
+
+/**
+ * Create a new VDI instance, and return its handle.
+ */
+extern bool
+xen_vdi_create(xen_session *session, xen_vdi *result, xen_vdi_record *record);
+
+
+/**
+ * Destroy the specified VDI instance.
+ */
+extern bool
+xen_vdi_destroy(xen_session *session, xen_vdi vdi);
+
+
+/**
+ * Get all the VDI instances with the given label.
+ */
+extern bool
+xen_vdi_get_by_name_label(xen_session *session, struct xen_vdi_set **result, char *label);
+
+
+/**
+ * Get the uuid field of the given VDI.
+ */
+extern bool
+xen_vdi_get_uuid(xen_session *session, char **result, xen_vdi vdi);
+
+
+/**
+ * Get the name/label field of the given VDI.
+ */
+extern bool
+xen_vdi_get_name_label(xen_session *session, char **result, xen_vdi vdi);
+
+
+/**
+ * Get the name/description field of the given VDI.
+ */
+extern bool
+xen_vdi_get_name_description(xen_session *session, char **result, xen_vdi vdi);
+
+
+/**
+ * Get the SR field of the given VDI.
+ */
+extern bool
+xen_vdi_get_sr(xen_session *session, xen_sr *result, xen_vdi vdi);
+
+
+/**
+ * Get the VBDs field of the given VDI.
+ */
+extern bool
+xen_vdi_get_vbds(xen_session *session, struct xen_vbd_set **result, xen_vdi vdi);
+
+
+/**
+ * Get the crash_dumps field of the given VDI.
+ */
+extern bool
+xen_vdi_get_crash_dumps(xen_session *session, struct xen_crashdump_set **result, xen_vdi vdi);
+
+
+/**
+ * Get the virtual_size field of the given VDI.
+ */
+extern bool
+xen_vdi_get_virtual_size(xen_session *session, int64_t *result, xen_vdi vdi);
+
+
+/**
+ * Get the physical_utilisation field of the given VDI.
+ */
+extern bool
+xen_vdi_get_physical_utilisation(xen_session *session, int64_t *result, xen_vdi vdi);
+
+
+/**
+ * Get the type field of the given VDI.
+ */
+extern bool
+xen_vdi_get_type(xen_session *session, enum xen_vdi_type *result, xen_vdi vdi);
+
+
+/**
+ * Get the sharable field of the given VDI.
+ */
+extern bool
+xen_vdi_get_sharable(xen_session *session, bool *result, xen_vdi vdi);
+
+
+/**
+ * Get the read_only field of the given VDI.
+ */
+extern bool
+xen_vdi_get_read_only(xen_session *session, bool *result, xen_vdi vdi);
+
+
+/**
+ * Get the other_config field of the given VDI.
+ */
+extern bool
+xen_vdi_get_other_config(xen_session *session, xen_string_string_map **result, xen_vdi vdi);
+
+
+/**
+ * Set the name/label field of the given VDI.
+ */
+extern bool
+xen_vdi_set_name_label(xen_session *session, xen_vdi vdi, char *label);
+
+
+/**
+ * Set the name/description field of the given VDI.
+ */
+extern bool
+xen_vdi_set_name_description(xen_session *session, xen_vdi vdi, char *description);
+
+
+/**
+ * Set the virtual_size field of the given VDI.
+ */
+extern bool
+xen_vdi_set_virtual_size(xen_session *session, xen_vdi vdi, int64_t virtual_size);
+
+
+/**
+ * Set the sharable field of the given VDI.
+ */
+extern bool
+xen_vdi_set_sharable(xen_session *session, xen_vdi vdi, bool sharable);
+
+
+/**
+ * Set the read_only field of the given VDI.
+ */
+extern bool
+xen_vdi_set_read_only(xen_session *session, xen_vdi vdi, bool read_only);
+
+
+/**
+ * Set the other_config field of the given VDI.
+ */
+extern bool
+xen_vdi_set_other_config(xen_session *session, xen_vdi vdi, xen_string_string_map *other_config);
+
+
+/**
+ * Add the given key-value pair to the other_config field of the given
+ * VDI.
+ */
+extern bool
+xen_vdi_add_to_other_config(xen_session *session, xen_vdi vdi, char *key, char *value);
+
+
+/**
+ * Remove the given key and its corresponding value from the
+ * other_config field of the given VDI.  If the key is not in that Map, then
+ * do nothing.
+ */
+extern bool
+xen_vdi_remove_from_other_config(xen_session *session, xen_vdi vdi, char *key);
+
+
+/**
+ * Return a list of all the VDIs known to the system.
+ */
+extern bool
+xen_vdi_get_all(xen_session *session, struct xen_vdi_set **result);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_vdi_decl.h b/tools/libxen/include/xen/api/xen_vdi_decl.h
new file mode 100644 (file)
index 0000000..13a328e
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_VDI_DECL_H
+#define XEN_VDI_DECL_H
+
+typedef void *xen_vdi;
+
+struct xen_vdi_set;
+struct xen_vdi_record;
+struct xen_vdi_record_set;
+struct xen_vdi_record_opt;
+struct xen_vdi_record_opt_set;
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_vdi_type.h b/tools/libxen/include/xen/api/xen_vdi_type.h
new file mode 100644 (file)
index 0000000..d98a2ab
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_VDI_TYPE_H
+#define XEN_VDI_TYPE_H
+
+
+#include <xen/api/xen_common.h>
+
+
+enum xen_vdi_type
+{
+    /**
+     * a disk that may be replaced on upgrade
+     */
+    XEN_VDI_TYPE_SYSTEM,
+
+    /**
+     * a disk that is always preserved on upgrade
+     */
+    XEN_VDI_TYPE_USER,
+
+    /**
+     * a disk that may be reformatted on upgrade
+     */
+    XEN_VDI_TYPE_EPHEMERAL,
+
+    /**
+     * a disk that stores a suspend image
+     */
+    XEN_VDI_TYPE_SUSPEND,
+
+    /**
+     * a disk that stores VM crashdump information
+     */
+    XEN_VDI_TYPE_CRASHDUMP
+};
+
+
+typedef struct xen_vdi_type_set
+{
+    size_t size;
+    enum xen_vdi_type contents[];
+} xen_vdi_type_set;
+
+/**
+ * Allocate a xen_vdi_type_set of the given size.
+ */
+extern xen_vdi_type_set *
+xen_vdi_type_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vdi_type_set.  The given set must have been
+ * allocated by this library.
+ */
+extern void
+xen_vdi_type_set_free(xen_vdi_type_set *set);
+
+
+/**
+ * Return the name corresponding to the given code.  This string must
+ * not be modified or freed.
+ */
+extern const char *
+xen_vdi_type_to_string(enum xen_vdi_type val);
+
+
+/**
+ * Return the correct code for the given string, or set the session
+ * object to failure and return an undefined value if the given string does
+ * not match a known code.
+ */
+extern enum xen_vdi_type
+xen_vdi_type_from_string(xen_session *session, const char *str);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_vif.h b/tools/libxen/include/xen/api/xen_vif.h
new file mode 100644 (file)
index 0000000..26608f0
--- /dev/null
@@ -0,0 +1,365 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_VIF_H
+#define XEN_VIF_H
+
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_network_decl.h>
+#include <xen/api/xen_string_set.h>
+#include <xen/api/xen_string_string_map.h>
+#include <xen/api/xen_vif_decl.h>
+#include <xen/api/xen_vif_metrics_decl.h>
+#include <xen/api/xen_vm_decl.h>
+
+
+/*
+ * The VIF class.
+ * 
+ * A virtual network interface.
+ */
+
+
+/**
+ * Free the given xen_vif.  The given handle must have been allocated
+ * by this library.
+ */
+extern void
+xen_vif_free(xen_vif vif);
+
+
+typedef struct xen_vif_set
+{
+    size_t size;
+    xen_vif *contents[];
+} xen_vif_set;
+
+/**
+ * Allocate a xen_vif_set of the given size.
+ */
+extern xen_vif_set *
+xen_vif_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vif_set.  The given set must have been allocated
+ * by this library.
+ */
+extern void
+xen_vif_set_free(xen_vif_set *set);
+
+
+typedef struct xen_vif_record
+{
+    xen_vif handle;
+    char *uuid;
+    char *device;
+    struct xen_network_record_opt *network;
+    struct xen_vm_record_opt *vm;
+    char *mac;
+    int64_t mtu;
+    bool currently_attached;
+    int64_t status_code;
+    char *status_detail;
+    xen_string_string_map *runtime_properties;
+    char *qos_algorithm_type;
+    xen_string_string_map *qos_algorithm_params;
+    struct xen_string_set *qos_supported_algorithms;
+    struct xen_vif_metrics_record_opt *metrics;
+} xen_vif_record;
+
+/**
+ * Allocate a xen_vif_record.
+ */
+extern xen_vif_record *
+xen_vif_record_alloc(void);
+
+/**
+ * Free the given xen_vif_record, and all referenced values.  The given
+ * record must have been allocated by this library.
+ */
+extern void
+xen_vif_record_free(xen_vif_record *record);
+
+
+typedef struct xen_vif_record_opt
+{
+    bool is_record;
+    union
+    {
+        xen_vif handle;
+        xen_vif_record *record;
+    } u;
+} xen_vif_record_opt;
+
+/**
+ * Allocate a xen_vif_record_opt.
+ */
+extern xen_vif_record_opt *
+xen_vif_record_opt_alloc(void);
+
+/**
+ * Free the given xen_vif_record_opt, and all referenced values.  The
+ * given record_opt must have been allocated by this library.
+ */
+extern void
+xen_vif_record_opt_free(xen_vif_record_opt *record_opt);
+
+
+typedef struct xen_vif_record_set
+{
+    size_t size;
+    xen_vif_record *contents[];
+} xen_vif_record_set;
+
+/**
+ * Allocate a xen_vif_record_set of the given size.
+ */
+extern xen_vif_record_set *
+xen_vif_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vif_record_set, and all referenced values.  The
+ * given set must have been allocated by this library.
+ */
+extern void
+xen_vif_record_set_free(xen_vif_record_set *set);
+
+
+
+typedef struct xen_vif_record_opt_set
+{
+    size_t size;
+    xen_vif_record_opt *contents[];
+} xen_vif_record_opt_set;
+
+/**
+ * Allocate a xen_vif_record_opt_set of the given size.
+ */
+extern xen_vif_record_opt_set *
+xen_vif_record_opt_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vif_record_opt_set, and all referenced values. 
+ * The given set must have been allocated by this library.
+ */
+extern void
+xen_vif_record_opt_set_free(xen_vif_record_opt_set *set);
+
+
+/**
+ * Get a record containing the current state of the given VIF.
+ */
+extern bool
+xen_vif_get_record(xen_session *session, xen_vif_record **result, xen_vif vif);
+
+
+/**
+ * Get a reference to the VIF instance with the specified UUID.
+ */
+extern bool
+xen_vif_get_by_uuid(xen_session *session, xen_vif *result, char *uuid);
+
+
+/**
+ * Create a new VIF instance, and return its handle.
+ */
+extern bool
+xen_vif_create(xen_session *session, xen_vif *result, xen_vif_record *record);
+
+
+/**
+ * Destroy the specified VIF instance.
+ */
+extern bool
+xen_vif_destroy(xen_session *session, xen_vif vif);
+
+
+/**
+ * Get the uuid field of the given VIF.
+ */
+extern bool
+xen_vif_get_uuid(xen_session *session, char **result, xen_vif vif);
+
+
+/**
+ * Get the device field of the given VIF.
+ */
+extern bool
+xen_vif_get_device(xen_session *session, char **result, xen_vif vif);
+
+
+/**
+ * Get the network field of the given VIF.
+ */
+extern bool
+xen_vif_get_network(xen_session *session, xen_network *result, xen_vif vif);
+
+
+/**
+ * Get the VM field of the given VIF.
+ */
+extern bool
+xen_vif_get_vm(xen_session *session, xen_vm *result, xen_vif vif);
+
+
+/**
+ * Get the MAC field of the given VIF.
+ */
+extern bool
+xen_vif_get_mac(xen_session *session, char **result, xen_vif vif);
+
+
+/**
+ * Get the MTU field of the given VIF.
+ */
+extern bool
+xen_vif_get_mtu(xen_session *session, int64_t *result, xen_vif vif);
+
+
+/**
+ * Get the currently_attached field of the given VIF.
+ */
+extern bool
+xen_vif_get_currently_attached(xen_session *session, bool *result, xen_vif vif);
+
+
+/**
+ * Get the status_code field of the given VIF.
+ */
+extern bool
+xen_vif_get_status_code(xen_session *session, int64_t *result, xen_vif vif);
+
+
+/**
+ * Get the status_detail field of the given VIF.
+ */
+extern bool
+xen_vif_get_status_detail(xen_session *session, char **result, xen_vif vif);
+
+
+/**
+ * Get the runtime_properties field of the given VIF.
+ */
+extern bool
+xen_vif_get_runtime_properties(xen_session *session, xen_string_string_map **result, xen_vif vif);
+
+
+/**
+ * Get the qos/algorithm_type field of the given VIF.
+ */
+extern bool
+xen_vif_get_qos_algorithm_type(xen_session *session, char **result, xen_vif vif);
+
+
+/**
+ * Get the qos/algorithm_params field of the given VIF.
+ */
+extern bool
+xen_vif_get_qos_algorithm_params(xen_session *session, xen_string_string_map **result, xen_vif vif);
+
+
+/**
+ * Get the qos/supported_algorithms field of the given VIF.
+ */
+extern bool
+xen_vif_get_qos_supported_algorithms(xen_session *session, struct xen_string_set **result, xen_vif vif);
+
+
+/**
+ * Get the metrics field of the given VIF.
+ */
+extern bool
+xen_vif_get_metrics(xen_session *session, xen_vif_metrics *result, xen_vif vif);
+
+
+/**
+ * Set the device field of the given VIF.
+ */
+extern bool
+xen_vif_set_device(xen_session *session, xen_vif vif, char *device);
+
+
+/**
+ * Set the MAC field of the given VIF.
+ */
+extern bool
+xen_vif_set_mac(xen_session *session, xen_vif vif, char *mac);
+
+
+/**
+ * Set the MTU field of the given VIF.
+ */
+extern bool
+xen_vif_set_mtu(xen_session *session, xen_vif vif, int64_t mtu);
+
+
+/**
+ * Set the qos/algorithm_type field of the given VIF.
+ */
+extern bool
+xen_vif_set_qos_algorithm_type(xen_session *session, xen_vif vif, char *algorithm_type);
+
+
+/**
+ * Set the qos/algorithm_params field of the given VIF.
+ */
+extern bool
+xen_vif_set_qos_algorithm_params(xen_session *session, xen_vif vif, xen_string_string_map *algorithm_params);
+
+
+/**
+ * Add the given key-value pair to the qos/algorithm_params field of
+ * the given VIF.
+ */
+extern bool
+xen_vif_add_to_qos_algorithm_params(xen_session *session, xen_vif vif, char *key, char *value);
+
+
+/**
+ * Remove the given key and its corresponding value from the
+ * qos/algorithm_params field of the given VIF.  If the key is not in that
+ * Map, then do nothing.
+ */
+extern bool
+xen_vif_remove_from_qos_algorithm_params(xen_session *session, xen_vif vif, char *key);
+
+
+/**
+ * Hotplug the specified VIF, dynamically attaching it to the running
+ * VM.
+ */
+extern bool
+xen_vif_plug(xen_session *session, xen_vif self);
+
+
+/**
+ * Hot-unplug the specified VIF, dynamically unattaching it from the
+ * running VM.
+ */
+extern bool
+xen_vif_unplug(xen_session *session, xen_vif self);
+
+
+/**
+ * Return a list of all the VIFs known to the system.
+ */
+extern bool
+xen_vif_get_all(xen_session *session, struct xen_vif_set **result);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_vif_decl.h b/tools/libxen/include/xen/api/xen_vif_decl.h
new file mode 100644 (file)
index 0000000..0d4c59d
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_VIF_DECL_H
+#define XEN_VIF_DECL_H
+
+typedef void *xen_vif;
+
+struct xen_vif_set;
+struct xen_vif_record;
+struct xen_vif_record_set;
+struct xen_vif_record_opt;
+struct xen_vif_record_opt_set;
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_vif_metrics.h b/tools/libxen/include/xen/api/xen_vif_metrics.h
new file mode 100644 (file)
index 0000000..a363137
--- /dev/null
@@ -0,0 +1,198 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_VIF_METRICS_H
+#define XEN_VIF_METRICS_H
+
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_vif_metrics_decl.h>
+
+
+/*
+ * The VIF_metrics class.
+ * 
+ * The metrics associated with a virtual network device.
+ */
+
+
+/**
+ * Free the given xen_vif_metrics.  The given handle must have been
+ * allocated by this library.
+ */
+extern void
+xen_vif_metrics_free(xen_vif_metrics vif_metrics);
+
+
+typedef struct xen_vif_metrics_set
+{
+    size_t size;
+    xen_vif_metrics *contents[];
+} xen_vif_metrics_set;
+
+/**
+ * Allocate a xen_vif_metrics_set of the given size.
+ */
+extern xen_vif_metrics_set *
+xen_vif_metrics_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vif_metrics_set.  The given set must have been
+ * allocated by this library.
+ */
+extern void
+xen_vif_metrics_set_free(xen_vif_metrics_set *set);
+
+
+typedef struct xen_vif_metrics_record
+{
+    xen_vif_metrics handle;
+    char *uuid;
+    double io_read_kbs;
+    double io_write_kbs;
+    time_t last_updated;
+} xen_vif_metrics_record;
+
+/**
+ * Allocate a xen_vif_metrics_record.
+ */
+extern xen_vif_metrics_record *
+xen_vif_metrics_record_alloc(void);
+
+/**
+ * Free the given xen_vif_metrics_record, and all referenced values. 
+ * The given record must have been allocated by this library.
+ */
+extern void
+xen_vif_metrics_record_free(xen_vif_metrics_record *record);
+
+
+typedef struct xen_vif_metrics_record_opt
+{
+    bool is_record;
+    union
+    {
+        xen_vif_metrics handle;
+        xen_vif_metrics_record *record;
+    } u;
+} xen_vif_metrics_record_opt;
+
+/**
+ * Allocate a xen_vif_metrics_record_opt.
+ */
+extern xen_vif_metrics_record_opt *
+xen_vif_metrics_record_opt_alloc(void);
+
+/**
+ * Free the given xen_vif_metrics_record_opt, and all referenced
+ * values.  The given record_opt must have been allocated by this library.
+ */
+extern void
+xen_vif_metrics_record_opt_free(xen_vif_metrics_record_opt *record_opt);
+
+
+typedef struct xen_vif_metrics_record_set
+{
+    size_t size;
+    xen_vif_metrics_record *contents[];
+} xen_vif_metrics_record_set;
+
+/**
+ * Allocate a xen_vif_metrics_record_set of the given size.
+ */
+extern xen_vif_metrics_record_set *
+xen_vif_metrics_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vif_metrics_record_set, and all referenced
+ * values.  The given set must have been allocated by this library.
+ */
+extern void
+xen_vif_metrics_record_set_free(xen_vif_metrics_record_set *set);
+
+
+
+typedef struct xen_vif_metrics_record_opt_set
+{
+    size_t size;
+    xen_vif_metrics_record_opt *contents[];
+} xen_vif_metrics_record_opt_set;
+
+/**
+ * Allocate a xen_vif_metrics_record_opt_set of the given size.
+ */
+extern xen_vif_metrics_record_opt_set *
+xen_vif_metrics_record_opt_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vif_metrics_record_opt_set, and all referenced
+ * values.  The given set must have been allocated by this library.
+ */
+extern void
+xen_vif_metrics_record_opt_set_free(xen_vif_metrics_record_opt_set *set);
+
+
+/**
+ * Get a record containing the current state of the given VIF_metrics.
+ */
+extern bool
+xen_vif_metrics_get_record(xen_session *session, xen_vif_metrics_record **result, xen_vif_metrics vif_metrics);
+
+
+/**
+ * Get a reference to the VIF_metrics instance with the specified UUID.
+ */
+extern bool
+xen_vif_metrics_get_by_uuid(xen_session *session, xen_vif_metrics *result, char *uuid);
+
+
+/**
+ * Get the uuid field of the given VIF_metrics.
+ */
+extern bool
+xen_vif_metrics_get_uuid(xen_session *session, char **result, xen_vif_metrics vif_metrics);
+
+
+/**
+ * Get the io/read_kbs field of the given VIF_metrics.
+ */
+extern bool
+xen_vif_metrics_get_io_read_kbs(xen_session *session, double *result, xen_vif_metrics vif_metrics);
+
+
+/**
+ * Get the io/write_kbs field of the given VIF_metrics.
+ */
+extern bool
+xen_vif_metrics_get_io_write_kbs(xen_session *session, double *result, xen_vif_metrics vif_metrics);
+
+
+/**
+ * Get the last_updated field of the given VIF_metrics.
+ */
+extern bool
+xen_vif_metrics_get_last_updated(xen_session *session, time_t *result, xen_vif_metrics vif_metrics);
+
+
+/**
+ * Return a list of all the VIF_metrics instances known to the system.
+ */
+extern bool
+xen_vif_metrics_get_all(xen_session *session, struct xen_vif_metrics_set **result);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_vif_metrics_decl.h b/tools/libxen/include/xen/api/xen_vif_metrics_decl.h
new file mode 100644 (file)
index 0000000..5734723
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_VIF_METRICS_DECL_H
+#define XEN_VIF_METRICS_DECL_H
+
+typedef void *xen_vif_metrics;
+
+struct xen_vif_metrics_set;
+struct xen_vif_metrics_record;
+struct xen_vif_metrics_record_set;
+struct xen_vif_metrics_record_opt;
+struct xen_vif_metrics_record_opt_set;
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_vm.h b/tools/libxen/include/xen/api/xen_vm.h
new file mode 100644 (file)
index 0000000..35448af
--- /dev/null
@@ -0,0 +1,894 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_VM_H
+#define XEN_VM_H
+
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_console_decl.h>
+#include <xen/api/xen_crashdump_decl.h>
+#include <xen/api/xen_host_decl.h>
+#include <xen/api/xen_on_crash_behaviour.h>
+#include <xen/api/xen_on_normal_exit.h>
+#include <xen/api/xen_string_string_map.h>
+#include <xen/api/xen_vbd_decl.h>
+#include <xen/api/xen_vdi_decl.h>
+#include <xen/api/xen_vif_decl.h>
+#include <xen/api/xen_vm_decl.h>
+#include <xen/api/xen_vm_guest_metrics_decl.h>
+#include <xen/api/xen_vm_metrics_decl.h>
+#include <xen/api/xen_vm_power_state.h>
+#include <xen/api/xen_vtpm_decl.h>
+
+
+/*
+ * The VM class.
+ * 
+ * A virtual machine (or 'guest').
+ */
+
+
+/**
+ * Free the given xen_vm.  The given handle must have been allocated by
+ * this library.
+ */
+extern void
+xen_vm_free(xen_vm vm);
+
+
+typedef struct xen_vm_set
+{
+    size_t size;
+    xen_vm *contents[];
+} xen_vm_set;
+
+/**
+ * Allocate a xen_vm_set of the given size.
+ */
+extern xen_vm_set *
+xen_vm_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vm_set.  The given set must have been allocated
+ * by this library.
+ */
+extern void
+xen_vm_set_free(xen_vm_set *set);
+
+
+typedef struct xen_vm_record
+{
+    xen_vm handle;
+    char *uuid;
+    enum xen_vm_power_state power_state;
+    char *name_label;
+    char *name_description;
+    int64_t user_version;
+    bool is_a_template;
+    bool auto_power_on;
+    struct xen_vdi_record_opt *suspend_vdi;
+    struct xen_host_record_opt *resident_on;
+    int64_t memory_static_max;
+    int64_t memory_dynamic_max;
+    int64_t memory_dynamic_min;
+    int64_t memory_static_min;
+    xen_string_string_map *vcpus_params;
+    int64_t vcpus_max;
+    int64_t vcpus_at_startup;
+    enum xen_on_normal_exit actions_after_shutdown;
+    enum xen_on_normal_exit actions_after_reboot;
+    enum xen_on_crash_behaviour actions_after_crash;
+    struct xen_console_record_opt_set *consoles;
+    struct xen_vif_record_opt_set *vifs;
+    struct xen_vbd_record_opt_set *vbds;
+    struct xen_crashdump_record_opt_set *crash_dumps;
+    struct xen_vtpm_record_opt_set *vtpms;
+    char *pv_bootloader;
+    char *pv_kernel;
+    char *pv_ramdisk;
+    char *pv_args;
+    char *pv_bootloader_args;
+    char *hvm_boot_policy;
+    xen_string_string_map *hvm_boot_params;
+    xen_string_string_map *platform;
+    char *pci_bus;
+    xen_string_string_map *other_config;
+    int64_t domid;
+    bool is_control_domain;
+    struct xen_vm_metrics_record_opt *metrics;
+    struct xen_vm_guest_metrics_record_opt *guest_metrics;
+} xen_vm_record;
+
+/**
+ * Allocate a xen_vm_record.
+ */
+extern xen_vm_record *
+xen_vm_record_alloc(void);
+
+/**
+ * Free the given xen_vm_record, and all referenced values.  The given
+ * record must have been allocated by this library.
+ */
+extern void
+xen_vm_record_free(xen_vm_record *record);
+
+
+typedef struct xen_vm_record_opt
+{
+    bool is_record;
+    union
+    {
+        xen_vm handle;
+        xen_vm_record *record;
+    } u;
+} xen_vm_record_opt;
+
+/**
+ * Allocate a xen_vm_record_opt.
+ */
+extern xen_vm_record_opt *
+xen_vm_record_opt_alloc(void);
+
+/**
+ * Free the given xen_vm_record_opt, and all referenced values.  The
+ * given record_opt must have been allocated by this library.
+ */
+extern void
+xen_vm_record_opt_free(xen_vm_record_opt *record_opt);
+
+
+typedef struct xen_vm_record_set
+{
+    size_t size;
+    xen_vm_record *contents[];
+} xen_vm_record_set;
+
+/**
+ * Allocate a xen_vm_record_set of the given size.
+ */
+extern xen_vm_record_set *
+xen_vm_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vm_record_set, and all referenced values.  The
+ * given set must have been allocated by this library.
+ */
+extern void
+xen_vm_record_set_free(xen_vm_record_set *set);
+
+
+
+typedef struct xen_vm_record_opt_set
+{
+    size_t size;
+    xen_vm_record_opt *contents[];
+} xen_vm_record_opt_set;
+
+/**
+ * Allocate a xen_vm_record_opt_set of the given size.
+ */
+extern xen_vm_record_opt_set *
+xen_vm_record_opt_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vm_record_opt_set, and all referenced values. 
+ * The given set must have been allocated by this library.
+ */
+extern void
+xen_vm_record_opt_set_free(xen_vm_record_opt_set *set);
+
+
+/**
+ * Get a record containing the current state of the given VM.
+ */
+extern bool
+xen_vm_get_record(xen_session *session, xen_vm_record **result, xen_vm vm);
+
+
+/**
+ * Get a reference to the VM instance with the specified UUID.
+ */
+extern bool
+xen_vm_get_by_uuid(xen_session *session, xen_vm *result, char *uuid);
+
+
+/**
+ * Create a new VM instance, and return its handle.
+ */
+extern bool
+xen_vm_create(xen_session *session, xen_vm *result, xen_vm_record *record);
+
+
+/**
+ * Destroy the specified VM.  The VM is completely removed from the
+ * system.  This function can only be called when the VM is in the Halted
+ * State.
+ */
+extern bool
+xen_vm_destroy(xen_session *session, xen_vm vm);
+
+
+/**
+ * Get all the VM instances with the given label.
+ */
+extern bool
+xen_vm_get_by_name_label(xen_session *session, struct xen_vm_set **result, char *label);
+
+
+/**
+ * Get the uuid field of the given VM.
+ */
+extern bool
+xen_vm_get_uuid(xen_session *session, char **result, xen_vm vm);
+
+
+/**
+ * Get the power_state field of the given VM.
+ */
+extern bool
+xen_vm_get_power_state(xen_session *session, enum xen_vm_power_state *result, xen_vm vm);
+
+
+/**
+ * Get the name/label field of the given VM.
+ */
+extern bool
+xen_vm_get_name_label(xen_session *session, char **result, xen_vm vm);
+
+
+/**
+ * Get the name/description field of the given VM.
+ */
+extern bool
+xen_vm_get_name_description(xen_session *session, char **result, xen_vm vm);
+
+
+/**
+ * Get the user_version field of the given VM.
+ */
+extern bool
+xen_vm_get_user_version(xen_session *session, int64_t *result, xen_vm vm);
+
+
+/**
+ * Get the is_a_template field of the given VM.
+ */
+extern bool
+xen_vm_get_is_a_template(xen_session *session, bool *result, xen_vm vm);
+
+
+/**
+ * Get the auto_power_on field of the given VM.
+ */
+extern bool
+xen_vm_get_auto_power_on(xen_session *session, bool *result, xen_vm vm);
+
+
+/**
+ * Get the suspend_VDI field of the given VM.
+ */
+extern bool
+xen_vm_get_suspend_vdi(xen_session *session, xen_vdi *result, xen_vm vm);
+
+
+/**
+ * Get the resident_on field of the given VM.
+ */
+extern bool
+xen_vm_get_resident_on(xen_session *session, xen_host *result, xen_vm vm);
+
+
+/**
+ * Get the memory/static_max field of the given VM.
+ */
+extern bool
+xen_vm_get_memory_static_max(xen_session *session, int64_t *result, xen_vm vm);
+
+
+/**
+ * Get the memory/dynamic_max field of the given VM.
+ */
+extern bool
+xen_vm_get_memory_dynamic_max(xen_session *session, int64_t *result, xen_vm vm);
+
+
+/**
+ * Get the memory/dynamic_min field of the given VM.
+ */
+extern bool
+xen_vm_get_memory_dynamic_min(xen_session *session, int64_t *result, xen_vm vm);
+
+
+/**
+ * Get the memory/static_min field of the given VM.
+ */
+extern bool
+xen_vm_get_memory_static_min(xen_session *session, int64_t *result, xen_vm vm);
+
+
+/**
+ * Get the VCPUs/params field of the given VM.
+ */
+extern bool
+xen_vm_get_vcpus_params(xen_session *session, xen_string_string_map **result, xen_vm vm);
+
+
+/**
+ * Get the VCPUs/max field of the given VM.
+ */
+extern bool
+xen_vm_get_vcpus_max(xen_session *session, int64_t *result, xen_vm vm);
+
+
+/**
+ * Get the VCPUs/at_startup field of the given VM.
+ */
+extern bool
+xen_vm_get_vcpus_at_startup(xen_session *session, int64_t *result, xen_vm vm);
+
+
+/**
+ * Get the actions/after_shutdown field of the given VM.
+ */
+extern bool
+xen_vm_get_actions_after_shutdown(xen_session *session, enum xen_on_normal_exit *result, xen_vm vm);
+
+
+/**
+ * Get the actions/after_reboot field of the given VM.
+ */
+extern bool
+xen_vm_get_actions_after_reboot(xen_session *session, enum xen_on_normal_exit *result, xen_vm vm);
+
+
+/**
+ * Get the actions/after_crash field of the given VM.
+ */
+extern bool
+xen_vm_get_actions_after_crash(xen_session *session, enum xen_on_crash_behaviour *result, xen_vm vm);
+
+
+/**
+ * Get the consoles field of the given VM.
+ */
+extern bool
+xen_vm_get_consoles(xen_session *session, struct xen_console_set **result, xen_vm vm);
+
+
+/**
+ * Get the VIFs field of the given VM.
+ */
+extern bool
+xen_vm_get_vifs(xen_session *session, struct xen_vif_set **result, xen_vm vm);
+
+
+/**
+ * Get the VBDs field of the given VM.
+ */
+extern bool
+xen_vm_get_vbds(xen_session *session, struct xen_vbd_set **result, xen_vm vm);
+
+
+/**
+ * Get the crash_dumps field of the given VM.
+ */
+extern bool
+xen_vm_get_crash_dumps(xen_session *session, struct xen_crashdump_set **result, xen_vm vm);
+
+
+/**
+ * Get the VTPMs field of the given VM.
+ */
+extern bool
+xen_vm_get_vtpms(xen_session *session, struct xen_vtpm_set **result, xen_vm vm);
+
+
+/**
+ * Get the PV/bootloader field of the given VM.
+ */
+extern bool
+xen_vm_get_pv_bootloader(xen_session *session, char **result, xen_vm vm);
+
+
+/**
+ * Get the PV/kernel field of the given VM.
+ */
+extern bool
+xen_vm_get_pv_kernel(xen_session *session, char **result, xen_vm vm);
+
+
+/**
+ * Get the PV/ramdisk field of the given VM.
+ */
+extern bool
+xen_vm_get_pv_ramdisk(xen_session *session, char **result, xen_vm vm);
+
+
+/**
+ * Get the PV/args field of the given VM.
+ */
+extern bool
+xen_vm_get_pv_args(xen_session *session, char **result, xen_vm vm);
+
+
+/**
+ * Get the PV/bootloader_args field of the given VM.
+ */
+extern bool
+xen_vm_get_pv_bootloader_args(xen_session *session, char **result, xen_vm vm);
+
+
+/**
+ * Get the HVM/boot_policy field of the given VM.
+ */
+extern bool
+xen_vm_get_hvm_boot_policy(xen_session *session, char **result, xen_vm vm);
+
+
+/**
+ * Get the HVM/boot_params field of the given VM.
+ */
+extern bool
+xen_vm_get_hvm_boot_params(xen_session *session, xen_string_string_map **result, xen_vm vm);
+
+
+/**
+ * Get the platform field of the given VM.
+ */
+extern bool
+xen_vm_get_platform(xen_session *session, xen_string_string_map **result, xen_vm vm);
+
+
+/**
+ * Get the PCI_bus field of the given VM.
+ */
+extern bool
+xen_vm_get_pci_bus(xen_session *session, char **result, xen_vm vm);
+
+
+/**
+ * Get the other_config field of the given VM.
+ */
+extern bool
+xen_vm_get_other_config(xen_session *session, xen_string_string_map **result, xen_vm vm);
+
+
+/**
+ * Get the domid field of the given VM.
+ */
+extern bool
+xen_vm_get_domid(xen_session *session, int64_t *result, xen_vm vm);
+
+
+/**
+ * Get the is_control_domain field of the given VM.
+ */
+extern bool
+xen_vm_get_is_control_domain(xen_session *session, bool *result, xen_vm vm);
+
+
+/**
+ * Get the metrics field of the given VM.
+ */
+extern bool
+xen_vm_get_metrics(xen_session *session, xen_vm_metrics *result, xen_vm vm);
+
+
+/**
+ * Get the guest_metrics field of the given VM.
+ */
+extern bool
+xen_vm_get_guest_metrics(xen_session *session, xen_vm_guest_metrics *result, xen_vm vm);
+
+
+/**
+ * Set the name/label field of the given VM.
+ */
+extern bool
+xen_vm_set_name_label(xen_session *session, xen_vm vm, char *label);
+
+
+/**
+ * Set the name/description field of the given VM.
+ */
+extern bool
+xen_vm_set_name_description(xen_session *session, xen_vm vm, char *description);
+
+
+/**
+ * Set the user_version field of the given VM.
+ */
+extern bool
+xen_vm_set_user_version(xen_session *session, xen_vm vm, int64_t user_version);
+
+
+/**
+ * Set the is_a_template field of the given VM.
+ */
+extern bool
+xen_vm_set_is_a_template(xen_session *session, xen_vm vm, bool is_a_template);
+
+
+/**
+ * Set the auto_power_on field of the given VM.
+ */
+extern bool
+xen_vm_set_auto_power_on(xen_session *session, xen_vm vm, bool auto_power_on);
+
+
+/**
+ * Set the memory/static_max field of the given VM.
+ */
+extern bool
+xen_vm_set_memory_static_max(xen_session *session, xen_vm vm, int64_t static_max);
+
+
+/**
+ * Set the memory/dynamic_max field of the given VM.
+ */
+extern bool
+xen_vm_set_memory_dynamic_max(xen_session *session, xen_vm vm, int64_t dynamic_max);
+
+
+/**
+ * Set the memory/dynamic_min field of the given VM.
+ */
+extern bool
+xen_vm_set_memory_dynamic_min(xen_session *session, xen_vm vm, int64_t dynamic_min);
+
+
+/**
+ * Set the memory/static_min field of the given VM.
+ */
+extern bool
+xen_vm_set_memory_static_min(xen_session *session, xen_vm vm, int64_t static_min);
+
+
+/**
+ * Set the VCPUs/params field of the given VM.
+ */
+extern bool
+xen_vm_set_vcpus_params(xen_session *session, xen_vm vm, xen_string_string_map *params);
+
+
+/**
+ * Add the given key-value pair to the VCPUs/params field of the given
+ * VM.
+ */
+extern bool
+xen_vm_add_to_vcpus_params(xen_session *session, xen_vm vm, char *key, char *value);
+
+
+/**
+ * Remove the given key and its corresponding value from the
+ * VCPUs/params field of the given VM.  If the key is not in that Map, then do
+ * nothing.
+ */
+extern bool
+xen_vm_remove_from_vcpus_params(xen_session *session, xen_vm vm, char *key);
+
+
+/**
+ * Set the VCPUs/max field of the given VM.
+ */
+extern bool
+xen_vm_set_vcpus_max(xen_session *session, xen_vm vm, int64_t max);
+
+
+/**
+ * Set the VCPUs/at_startup field of the given VM.
+ */
+extern bool
+xen_vm_set_vcpus_at_startup(xen_session *session, xen_vm vm, int64_t at_startup);
+
+
+/**
+ * Set the actions/after_shutdown field of the given VM.
+ */
+extern bool
+xen_vm_set_actions_after_shutdown(xen_session *session, xen_vm vm, enum xen_on_normal_exit after_shutdown);
+
+
+/**
+ * Set the actions/after_reboot field of the given VM.
+ */
+extern bool
+xen_vm_set_actions_after_reboot(xen_session *session, xen_vm vm, enum xen_on_normal_exit after_reboot);
+
+
+/**
+ * Set the actions/after_crash field of the given VM.
+ */
+extern bool
+xen_vm_set_actions_after_crash(xen_session *session, xen_vm vm, enum xen_on_crash_behaviour after_crash);
+
+
+/**
+ * Set the PV/bootloader field of the given VM.
+ */
+extern bool
+xen_vm_set_pv_bootloader(xen_session *session, xen_vm vm, char *bootloader);
+
+
+/**
+ * Set the PV/kernel field of the given VM.
+ */
+extern bool
+xen_vm_set_pv_kernel(xen_session *session, xen_vm vm, char *kernel);
+
+
+/**
+ * Set the PV/ramdisk field of the given VM.
+ */
+extern bool
+xen_vm_set_pv_ramdisk(xen_session *session, xen_vm vm, char *ramdisk);
+
+
+/**
+ * Set the PV/args field of the given VM.
+ */
+extern bool
+xen_vm_set_pv_args(xen_session *session, xen_vm vm, char *args);
+
+
+/**
+ * Set the PV/bootloader_args field of the given VM.
+ */
+extern bool
+xen_vm_set_pv_bootloader_args(xen_session *session, xen_vm vm, char *bootloader_args);
+
+
+/**
+ * Set the HVM/boot_policy field of the given VM.
+ */
+extern bool
+xen_vm_set_hvm_boot_policy(xen_session *session, xen_vm vm, char *boot_policy);
+
+
+/**
+ * Set the HVM/boot_params field of the given VM.
+ */
+extern bool
+xen_vm_set_hvm_boot_params(xen_session *session, xen_vm vm, xen_string_string_map *boot_params);
+
+
+/**
+ * Add the given key-value pair to the HVM/boot_params field of the
+ * given VM.
+ */
+extern bool
+xen_vm_add_to_hvm_boot_params(xen_session *session, xen_vm vm, char *key, char *value);
+
+
+/**
+ * Remove the given key and its corresponding value from the
+ * HVM/boot_params field of the given VM.  If the key is not in that Map, then
+ * do nothing.
+ */
+extern bool
+xen_vm_remove_from_hvm_boot_params(xen_session *session, xen_vm vm, char *key);
+
+
+/**
+ * Set the platform field of the given VM.
+ */
+extern bool
+xen_vm_set_platform(xen_session *session, xen_vm vm, xen_string_string_map *platform);
+
+
+/**
+ * Add the given key-value pair to the platform field of the given VM.
+ */
+extern bool
+xen_vm_add_to_platform(xen_session *session, xen_vm vm, char *key, char *value);
+
+
+/**
+ * Remove the given key and its corresponding value from the platform
+ * field of the given VM.  If the key is not in that Map, then do nothing.
+ */
+extern bool
+xen_vm_remove_from_platform(xen_session *session, xen_vm vm, char *key);
+
+
+/**
+ * Set the PCI_bus field of the given VM.
+ */
+extern bool
+xen_vm_set_pci_bus(xen_session *session, xen_vm vm, char *pci_bus);
+
+
+/**
+ * Set the other_config field of the given VM.
+ */
+extern bool
+xen_vm_set_other_config(xen_session *session, xen_vm vm, xen_string_string_map *other_config);
+
+
+/**
+ * Add the given key-value pair to the other_config field of the given
+ * VM.
+ */
+extern bool
+xen_vm_add_to_other_config(xen_session *session, xen_vm vm, char *key, char *value);
+
+
+/**
+ * Remove the given key and its corresponding value from the
+ * other_config field of the given VM.  If the key is not in that Map, then do
+ * nothing.
+ */
+extern bool
+xen_vm_remove_from_other_config(xen_session *session, xen_vm vm, char *key);
+
+
+/**
+ * Clones the specified VM, making a new VM. Clone automatically
+ * exploits the capabilities of the underlying storage repository in which the
+ * VM's disk images are stored (e.g. Copy on Write).   This function can only
+ * be called when the VM is in the Halted State.
+ */
+extern bool
+xen_vm_clone(xen_session *session, xen_vm *result, xen_vm vm, char *new_name);
+
+
+/**
+ * Start the specified VM.  This function can only be called with the
+ * VM is in the Halted State.
+ */
+extern bool
+xen_vm_start(xen_session *session, xen_vm vm, bool start_paused);
+
+
+/**
+ * Pause the specified VM. This can only be called when the specified
+ * VM is in the Running state.
+ */
+extern bool
+xen_vm_pause(xen_session *session, xen_vm vm);
+
+
+/**
+ * Resume the specified VM. This can only be called when the specified
+ * VM is in the Paused state.
+ */
+extern bool
+xen_vm_unpause(xen_session *session, xen_vm vm);
+
+
+/**
+ * Attempt to cleanly shutdown the specified VM. (Note: this may not be
+ * supported---e.g. if a guest agent is not installed).
+ * 
+ * Once shutdown has been completed perform poweroff action specified in guest
+ * configuration.
+ * 
+ * This can only be called when the specified VM is in the Running state.
+ */
+extern bool
+xen_vm_clean_shutdown(xen_session *session, xen_vm vm);
+
+
+/**
+ * Attempt to cleanly shutdown the specified VM (Note: this may not be
+ * supported---e.g. if a guest agent is not installed).
+ * 
+ * Once shutdown has been completed perform reboot action specified in guest
+ * configuration.
+ * 
+ * This can only be called when the specified VM is in the Running state.
+ */
+extern bool
+xen_vm_clean_reboot(xen_session *session, xen_vm vm);
+
+
+/**
+ * Stop executing the specified VM without attempting a clean shutdown.
+ * Then perform poweroff action specified in VM configuration.
+ */
+extern bool
+xen_vm_hard_shutdown(xen_session *session, xen_vm vm);
+
+
+/**
+ * Stop executing the specified VM without attempting a clean shutdown.
+ * Then perform reboot action specified in VM configuration
+ */
+extern bool
+xen_vm_hard_reboot(xen_session *session, xen_vm vm);
+
+
+/**
+ * Suspend the specified VM to disk.  This can only be called when the
+ * specified VM is in the Running state.
+ */
+extern bool
+xen_vm_suspend(xen_session *session, xen_vm vm);
+
+
+/**
+ * Awaken the specified VM and resume it.  This can only be called when
+ * the specified VM is in the Suspended state.
+ */
+extern bool
+xen_vm_resume(xen_session *session, xen_vm vm, bool start_paused);
+
+
+/**
+ * Set this VM's VCPUs/at_startup value, and set the same value on the
+ * VM, if running
+ */
+extern bool
+xen_vm_set_vcpus_number_live(xen_session *session, xen_vm self, int64_t nvcpu);
+
+
+/**
+ * Add the given key-value pair to VM.VCPUs_params, and apply that
+ * value on the running VM.
+ */
+extern bool
+xen_vm_add_to_vcpus_params_live(xen_session *session, xen_vm self, char *key, char *value);
+
+
+/**
+ * Set memory_dynamic_max in database and on running VM.
+ */
+extern bool
+xen_vm_set_memory_dynamic_max_live(xen_session *session, xen_vm self, int64_t max);
+
+
+/**
+ * Set memory_dynamic_min in database and on running VM.
+ */
+extern bool
+xen_vm_set_memory_dynamic_min_live(xen_session *session, xen_vm self, int64_t min);
+
+
+/**
+ * Send the given key as a sysrq to this VM.  The key is specified as a
+ * single character (a String of length 1).  This can only be called when the
+ * specified VM is in the Running state.
+ */
+extern bool
+xen_vm_send_sysrq(xen_session *session, xen_vm vm, char *key);
+
+
+/**
+ * Send the named trigger to this VM.  This can only be called when the
+ * specified VM is in the Running state.
+ */
+extern bool
+xen_vm_send_trigger(xen_session *session, xen_vm vm, char *trigger);
+
+
+/**
+ * Migrate the VM to another host.  This can only be called when the
+ * specified VM is in the Running state.
+ */
+extern bool
+xen_vm_migrate(xen_session *session, xen_vm vm, char *dest, bool live, xen_string_string_map *options);
+
+
+/**
+ * Return a list of all the VMs known to the system.
+ */
+extern bool
+xen_vm_get_all(xen_session *session, struct xen_vm_set **result);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_vm_decl.h b/tools/libxen/include/xen/api/xen_vm_decl.h
new file mode 100644 (file)
index 0000000..f4ca986
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_VM_DECL_H
+#define XEN_VM_DECL_H
+
+typedef void *xen_vm;
+
+struct xen_vm_set;
+struct xen_vm_record;
+struct xen_vm_record_set;
+struct xen_vm_record_opt;
+struct xen_vm_record_opt_set;
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_vm_guest_metrics.h b/tools/libxen/include/xen/api/xen_vm_guest_metrics.h
new file mode 100644 (file)
index 0000000..fd4d23a
--- /dev/null
@@ -0,0 +1,234 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_VM_GUEST_METRICS_H
+#define XEN_VM_GUEST_METRICS_H
+
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_string_string_map.h>
+#include <xen/api/xen_vm_guest_metrics_decl.h>
+
+
+/*
+ * The VM_guest_metrics class.
+ * 
+ * The metrics reported by the guest (as opposed to inferred from outside).
+ */
+
+
+/**
+ * Free the given xen_vm_guest_metrics.  The given handle must have
+ * been allocated by this library.
+ */
+extern void
+xen_vm_guest_metrics_free(xen_vm_guest_metrics vm_guest_metrics);
+
+
+typedef struct xen_vm_guest_metrics_set
+{
+    size_t size;
+    xen_vm_guest_metrics *contents[];
+} xen_vm_guest_metrics_set;
+
+/**
+ * Allocate a xen_vm_guest_metrics_set of the given size.
+ */
+extern xen_vm_guest_metrics_set *
+xen_vm_guest_metrics_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vm_guest_metrics_set.  The given set must have
+ * been allocated by this library.
+ */
+extern void
+xen_vm_guest_metrics_set_free(xen_vm_guest_metrics_set *set);
+
+
+typedef struct xen_vm_guest_metrics_record
+{
+    xen_vm_guest_metrics handle;
+    char *uuid;
+    xen_string_string_map *os_version;
+    xen_string_string_map *pv_drivers_version;
+    xen_string_string_map *memory;
+    xen_string_string_map *disks;
+    xen_string_string_map *networks;
+    xen_string_string_map *other;
+    time_t last_updated;
+} xen_vm_guest_metrics_record;
+
+/**
+ * Allocate a xen_vm_guest_metrics_record.
+ */
+extern xen_vm_guest_metrics_record *
+xen_vm_guest_metrics_record_alloc(void);
+
+/**
+ * Free the given xen_vm_guest_metrics_record, and all referenced
+ * values.  The given record must have been allocated by this library.
+ */
+extern void
+xen_vm_guest_metrics_record_free(xen_vm_guest_metrics_record *record);
+
+
+typedef struct xen_vm_guest_metrics_record_opt
+{
+    bool is_record;
+    union
+    {
+        xen_vm_guest_metrics handle;
+        xen_vm_guest_metrics_record *record;
+    } u;
+} xen_vm_guest_metrics_record_opt;
+
+/**
+ * Allocate a xen_vm_guest_metrics_record_opt.
+ */
+extern xen_vm_guest_metrics_record_opt *
+xen_vm_guest_metrics_record_opt_alloc(void);
+
+/**
+ * Free the given xen_vm_guest_metrics_record_opt, and all referenced
+ * values.  The given record_opt must have been allocated by this library.
+ */
+extern void
+xen_vm_guest_metrics_record_opt_free(xen_vm_guest_metrics_record_opt *record_opt);
+
+
+typedef struct xen_vm_guest_metrics_record_set
+{
+    size_t size;
+    xen_vm_guest_metrics_record *contents[];
+} xen_vm_guest_metrics_record_set;
+
+/**
+ * Allocate a xen_vm_guest_metrics_record_set of the given size.
+ */
+extern xen_vm_guest_metrics_record_set *
+xen_vm_guest_metrics_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vm_guest_metrics_record_set, and all referenced
+ * values.  The given set must have been allocated by this library.
+ */
+extern void
+xen_vm_guest_metrics_record_set_free(xen_vm_guest_metrics_record_set *set);
+
+
+
+typedef struct xen_vm_guest_metrics_record_opt_set
+{
+    size_t size;
+    xen_vm_guest_metrics_record_opt *contents[];
+} xen_vm_guest_metrics_record_opt_set;
+
+/**
+ * Allocate a xen_vm_guest_metrics_record_opt_set of the given size.
+ */
+extern xen_vm_guest_metrics_record_opt_set *
+xen_vm_guest_metrics_record_opt_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vm_guest_metrics_record_opt_set, and all
+ * referenced values.  The given set must have been allocated by this library.
+ */
+extern void
+xen_vm_guest_metrics_record_opt_set_free(xen_vm_guest_metrics_record_opt_set *set);
+
+
+/**
+ * Get a record containing the current state of the given
+ * VM_guest_metrics.
+ */
+extern bool
+xen_vm_guest_metrics_get_record(xen_session *session, xen_vm_guest_metrics_record **result, xen_vm_guest_metrics vm_guest_metrics);
+
+
+/**
+ * Get a reference to the VM_guest_metrics instance with the specified
+ * UUID.
+ */
+extern bool
+xen_vm_guest_metrics_get_by_uuid(xen_session *session, xen_vm_guest_metrics *result, char *uuid);
+
+
+/**
+ * Get the uuid field of the given VM_guest_metrics.
+ */
+extern bool
+xen_vm_guest_metrics_get_uuid(xen_session *session, char **result, xen_vm_guest_metrics vm_guest_metrics);
+
+
+/**
+ * Get the os_version field of the given VM_guest_metrics.
+ */
+extern bool
+xen_vm_guest_metrics_get_os_version(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
+
+
+/**
+ * Get the PV_drivers_version field of the given VM_guest_metrics.
+ */
+extern bool
+xen_vm_guest_metrics_get_pv_drivers_version(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
+
+
+/**
+ * Get the memory field of the given VM_guest_metrics.
+ */
+extern bool
+xen_vm_guest_metrics_get_memory(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
+
+
+/**
+ * Get the disks field of the given VM_guest_metrics.
+ */
+extern bool
+xen_vm_guest_metrics_get_disks(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
+
+
+/**
+ * Get the networks field of the given VM_guest_metrics.
+ */
+extern bool
+xen_vm_guest_metrics_get_networks(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
+
+
+/**
+ * Get the other field of the given VM_guest_metrics.
+ */
+extern bool
+xen_vm_guest_metrics_get_other(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
+
+
+/**
+ * Get the last_updated field of the given VM_guest_metrics.
+ */
+extern bool
+xen_vm_guest_metrics_get_last_updated(xen_session *session, time_t *result, xen_vm_guest_metrics vm_guest_metrics);
+
+
+/**
+ * Return a list of all the VM_guest_metrics instances known to the
+ * system.
+ */
+extern bool
+xen_vm_guest_metrics_get_all(xen_session *session, struct xen_vm_guest_metrics_set **result);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_vm_guest_metrics_decl.h b/tools/libxen/include/xen/api/xen_vm_guest_metrics_decl.h
new file mode 100644 (file)
index 0000000..837528b
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_VM_GUEST_METRICS_DECL_H
+#define XEN_VM_GUEST_METRICS_DECL_H
+
+typedef void *xen_vm_guest_metrics;
+
+struct xen_vm_guest_metrics_set;
+struct xen_vm_guest_metrics_record;
+struct xen_vm_guest_metrics_record_set;
+struct xen_vm_guest_metrics_record_opt;
+struct xen_vm_guest_metrics_record_opt_set;
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_vm_metrics.h b/tools/libxen/include/xen/api/xen_vm_metrics.h
new file mode 100644 (file)
index 0000000..128c1a3
--- /dev/null
@@ -0,0 +1,251 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_VM_METRICS_H
+#define XEN_VM_METRICS_H
+
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_int_float_map.h>
+#include <xen/api/xen_int_int_map.h>
+#include <xen/api/xen_int_string_set_map.h>
+#include <xen/api/xen_string_set.h>
+#include <xen/api/xen_string_string_map.h>
+#include <xen/api/xen_vm_metrics_decl.h>
+
+
+/*
+ * The VM_metrics class.
+ * 
+ * The metrics associated with a VM.
+ */
+
+
+/**
+ * Free the given xen_vm_metrics.  The given handle must have been
+ * allocated by this library.
+ */
+extern void
+xen_vm_metrics_free(xen_vm_metrics vm_metrics);
+
+
+typedef struct xen_vm_metrics_set
+{
+    size_t size;
+    xen_vm_metrics *contents[];
+} xen_vm_metrics_set;
+
+/**
+ * Allocate a xen_vm_metrics_set of the given size.
+ */
+extern xen_vm_metrics_set *
+xen_vm_metrics_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vm_metrics_set.  The given set must have been
+ * allocated by this library.
+ */
+extern void
+xen_vm_metrics_set_free(xen_vm_metrics_set *set);
+
+
+typedef struct xen_vm_metrics_record
+{
+    xen_vm_metrics handle;
+    char *uuid;
+    int64_t memory_actual;
+    int64_t vcpus_number;
+    xen_int_float_map *vcpus_utilisation;
+    xen_int_int_map *vcpus_cpu;
+    xen_string_string_map *vcpus_params;
+    xen_int_string_set_map *vcpus_flags;
+    struct xen_string_set *state;
+    time_t start_time;
+    time_t last_updated;
+} xen_vm_metrics_record;
+
+/**
+ * Allocate a xen_vm_metrics_record.
+ */
+extern xen_vm_metrics_record *
+xen_vm_metrics_record_alloc(void);
+
+/**
+ * Free the given xen_vm_metrics_record, and all referenced values. 
+ * The given record must have been allocated by this library.
+ */
+extern void
+xen_vm_metrics_record_free(xen_vm_metrics_record *record);
+
+
+typedef struct xen_vm_metrics_record_opt
+{
+    bool is_record;
+    union
+    {
+        xen_vm_metrics handle;
+        xen_vm_metrics_record *record;
+    } u;
+} xen_vm_metrics_record_opt;
+
+/**
+ * Allocate a xen_vm_metrics_record_opt.
+ */
+extern xen_vm_metrics_record_opt *
+xen_vm_metrics_record_opt_alloc(void);
+
+/**
+ * Free the given xen_vm_metrics_record_opt, and all referenced values.
+ *  The given record_opt must have been allocated by this library.
+ */
+extern void
+xen_vm_metrics_record_opt_free(xen_vm_metrics_record_opt *record_opt);
+
+
+typedef struct xen_vm_metrics_record_set
+{
+    size_t size;
+    xen_vm_metrics_record *contents[];
+} xen_vm_metrics_record_set;
+
+/**
+ * Allocate a xen_vm_metrics_record_set of the given size.
+ */
+extern xen_vm_metrics_record_set *
+xen_vm_metrics_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vm_metrics_record_set, and all referenced values.
+ *  The given set must have been allocated by this library.
+ */
+extern void
+xen_vm_metrics_record_set_free(xen_vm_metrics_record_set *set);
+
+
+
+typedef struct xen_vm_metrics_record_opt_set
+{
+    size_t size;
+    xen_vm_metrics_record_opt *contents[];
+} xen_vm_metrics_record_opt_set;
+
+/**
+ * Allocate a xen_vm_metrics_record_opt_set of the given size.
+ */
+extern xen_vm_metrics_record_opt_set *
+xen_vm_metrics_record_opt_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vm_metrics_record_opt_set, and all referenced
+ * values.  The given set must have been allocated by this library.
+ */
+extern void
+xen_vm_metrics_record_opt_set_free(xen_vm_metrics_record_opt_set *set);
+
+
+/**
+ * Get a record containing the current state of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_record(xen_session *session, xen_vm_metrics_record **result, xen_vm_metrics vm_metrics);
+
+
+/**
+ * Get a reference to the VM_metrics instance with the specified UUID.
+ */
+extern bool
+xen_vm_metrics_get_by_uuid(xen_session *session, xen_vm_metrics *result, char *uuid);
+
+
+/**
+ * Get the uuid field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_uuid(xen_session *session, char **result, xen_vm_metrics vm_metrics);
+
+
+/**
+ * Get the memory/actual field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_memory_actual(xen_session *session, int64_t *result, xen_vm_metrics vm_metrics);
+
+
+/**
+ * Get the VCPUs/number field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_vcpus_number(xen_session *session, int64_t *result, xen_vm_metrics vm_metrics);
+
+
+/**
+ * Get the VCPUs/utilisation field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_vcpus_utilisation(xen_session *session, xen_int_float_map **result, xen_vm_metrics vm_metrics);
+
+
+/**
+ * Get the VCPUs/CPU field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_vcpus_cpu(xen_session *session, xen_int_int_map **result, xen_vm_metrics vm_metrics);
+
+
+/**
+ * Get the VCPUs/params field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_vcpus_params(xen_session *session, xen_string_string_map **result, xen_vm_metrics vm_metrics);
+
+
+/**
+ * Get the VCPUs/flags field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_vcpus_flags(xen_session *session, xen_int_string_set_map **result, xen_vm_metrics vm_metrics);
+
+
+/**
+ * Get the state field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_state(xen_session *session, struct xen_string_set **result, xen_vm_metrics vm_metrics);
+
+
+/**
+ * Get the start_time field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_start_time(xen_session *session, time_t *result, xen_vm_metrics vm_metrics);
+
+
+/**
+ * Get the last_updated field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_last_updated(xen_session *session, time_t *result, xen_vm_metrics vm_metrics);
+
+
+/**
+ * Return a list of all the VM_metrics instances known to the system.
+ */
+extern bool
+xen_vm_metrics_get_all(xen_session *session, struct xen_vm_metrics_set **result);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_vm_metrics_decl.h b/tools/libxen/include/xen/api/xen_vm_metrics_decl.h
new file mode 100644 (file)
index 0000000..76810b5
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_VM_METRICS_DECL_H
+#define XEN_VM_METRICS_DECL_H
+
+typedef void *xen_vm_metrics;
+
+struct xen_vm_metrics_set;
+struct xen_vm_metrics_record;
+struct xen_vm_metrics_record_set;
+struct xen_vm_metrics_record_opt;
+struct xen_vm_metrics_record_opt_set;
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_vm_power_state.h b/tools/libxen/include/xen/api/xen_vm_power_state.h
new file mode 100644 (file)
index 0000000..649f49a
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_VM_POWER_STATE_H
+#define XEN_VM_POWER_STATE_H
+
+
+#include <xen/api/xen_common.h>
+
+
+enum xen_vm_power_state
+{
+    /**
+     * Halted
+     */
+    XEN_VM_POWER_STATE_HALTED,
+
+    /**
+     * Paused
+     */
+    XEN_VM_POWER_STATE_PAUSED,
+
+    /**
+     * Running
+     */
+    XEN_VM_POWER_STATE_RUNNING,
+
+    /**
+     * Suspended
+     */
+    XEN_VM_POWER_STATE_SUSPENDED,
+
+    /**
+     * Some other unknown state
+     */
+    XEN_VM_POWER_STATE_UNKNOWN
+};
+
+
+typedef struct xen_vm_power_state_set
+{
+    size_t size;
+    enum xen_vm_power_state contents[];
+} xen_vm_power_state_set;
+
+/**
+ * Allocate a xen_vm_power_state_set of the given size.
+ */
+extern xen_vm_power_state_set *
+xen_vm_power_state_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vm_power_state_set.  The given set must have been
+ * allocated by this library.
+ */
+extern void
+xen_vm_power_state_set_free(xen_vm_power_state_set *set);
+
+
+/**
+ * Return the name corresponding to the given code.  This string must
+ * not be modified or freed.
+ */
+extern const char *
+xen_vm_power_state_to_string(enum xen_vm_power_state val);
+
+
+/**
+ * Return the correct code for the given string, or set the session
+ * object to failure and return an undefined value if the given string does
+ * not match a known code.
+ */
+extern enum xen_vm_power_state
+xen_vm_power_state_from_string(xen_session *session, const char *str);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_vtpm.h b/tools/libxen/include/xen/api/xen_vtpm.h
new file mode 100644 (file)
index 0000000..920948d
--- /dev/null
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ * Copyright (c) 2006, IBM Corp.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_VTPM_H
+#define XEN_VTPM_H
+
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_vm_decl.h>
+#include <xen/api/xen_vtpm_decl.h>
+
+
+/*
+ * The VTPM class.
+ * 
+ * A virtual TPM device.
+ */
+
+
+/**
+ * Free the given xen_vtpm.  The given handle must have been allocated
+ * by this library.
+ */
+extern void
+xen_vtpm_free(xen_vtpm vtpm);
+
+
+typedef struct xen_vtpm_set
+{
+    size_t size;
+    xen_vtpm *contents[];
+} xen_vtpm_set;
+
+/**
+ * Allocate a xen_vtpm_set of the given size.
+ */
+extern xen_vtpm_set *
+xen_vtpm_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vtpm_set.  The given set must have been allocated
+ * by this library.
+ */
+extern void
+xen_vtpm_set_free(xen_vtpm_set *set);
+
+
+typedef struct xen_vtpm_record
+{
+    xen_vtpm handle;
+    char *uuid;
+    struct xen_vm_record_opt *vm;
+    struct xen_vm_record_opt *backend;
+} xen_vtpm_record;
+
+/**
+ * Allocate a xen_vtpm_record.
+ */
+extern xen_vtpm_record *
+xen_vtpm_record_alloc(void);
+
+/**
+ * Free the given xen_vtpm_record, and all referenced values.  The
+ * given record must have been allocated by this library.
+ */
+extern void
+xen_vtpm_record_free(xen_vtpm_record *record);
+
+
+typedef struct xen_vtpm_record_opt
+{
+    bool is_record;
+    union
+    {
+        xen_vtpm handle;
+        xen_vtpm_record *record;
+    } u;
+} xen_vtpm_record_opt;
+
+/**
+ * Allocate a xen_vtpm_record_opt.
+ */
+extern xen_vtpm_record_opt *
+xen_vtpm_record_opt_alloc(void);
+
+/**
+ * Free the given xen_vtpm_record_opt, and all referenced values.  The
+ * given record_opt must have been allocated by this library.
+ */
+extern void
+xen_vtpm_record_opt_free(xen_vtpm_record_opt *record_opt);
+
+
+typedef struct xen_vtpm_record_set
+{
+    size_t size;
+    xen_vtpm_record *contents[];
+} xen_vtpm_record_set;
+
+/**
+ * Allocate a xen_vtpm_record_set of the given size.
+ */
+extern xen_vtpm_record_set *
+xen_vtpm_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vtpm_record_set, and all referenced values.  The
+ * given set must have been allocated by this library.
+ */
+extern void
+xen_vtpm_record_set_free(xen_vtpm_record_set *set);
+
+
+
+typedef struct xen_vtpm_record_opt_set
+{
+    size_t size;
+    xen_vtpm_record_opt *contents[];
+} xen_vtpm_record_opt_set;
+
+/**
+ * Allocate a xen_vtpm_record_opt_set of the given size.
+ */
+extern xen_vtpm_record_opt_set *
+xen_vtpm_record_opt_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vtpm_record_opt_set, and all referenced values. 
+ * The given set must have been allocated by this library.
+ */
+extern void
+xen_vtpm_record_opt_set_free(xen_vtpm_record_opt_set *set);
+
+
+/**
+ * Get a record containing the current state of the given VTPM.
+ */
+extern bool
+xen_vtpm_get_record(xen_session *session, xen_vtpm_record **result, xen_vtpm vtpm);
+
+
+/**
+ * Get a reference to the VTPM instance with the specified UUID.
+ */
+extern bool
+xen_vtpm_get_by_uuid(xen_session *session, xen_vtpm *result, char *uuid);
+
+
+/**
+ * Create a new VTPM instance, and return its handle.
+ */
+extern bool
+xen_vtpm_create(xen_session *session, xen_vtpm *result, xen_vtpm_record *record);
+
+
+/**
+ * Destroy the specified VTPM instance.
+ */
+extern bool
+xen_vtpm_destroy(xen_session *session, xen_vtpm vtpm);
+
+
+/**
+ * Get the uuid field of the given VTPM.
+ */
+extern bool
+xen_vtpm_get_uuid(xen_session *session, char **result, xen_vtpm vtpm);
+
+
+/**
+ * Get the VM field of the given VTPM.
+ */
+extern bool
+xen_vtpm_get_vm(xen_session *session, xen_vm *result, xen_vtpm vtpm);
+
+
+/**
+ * Get the backend field of the given VTPM.
+ */
+extern bool
+xen_vtpm_get_backend(xen_session *session, xen_vm *result, xen_vtpm vtpm);
+
+
+#endif
diff --git a/tools/libxen/include/xen/api/xen_vtpm_decl.h b/tools/libxen/include/xen/api/xen_vtpm_decl.h
new file mode 100644 (file)
index 0000000..7798e38
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2006, XenSource Inc.
+ * Copyright (c) 2006, IBM Corp.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_VTPM_DECL_H
+#define XEN_VTPM_DECL_H
+
+typedef void *xen_vtpm;
+
+struct xen_vtpm_set;
+struct xen_vtpm_record;
+struct xen_vtpm_record_set;
+struct xen_vtpm_record_opt;
+struct xen_vtpm_record_opt_set;
+
+#endif
diff --git a/tools/libxen/include/xen_common.h b/tools/libxen/include/xen_common.h
deleted file mode 100644 (file)
index fc8d092..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * Copyright (c) 2006 XenSource, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_COMMON_H
-#define XEN_COMMON_H
-
-
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <time.h>
-
-#include "xen_host_decl.h"
-
-
-typedef bool (*xen_result_func)(const void *data, size_t len,
-                                void *result_handle);
-
-
-/**
- * len does not include a terminating \0.
- */
-typedef int (*xen_call_func)(const void *, size_t len, void *user_handle,
-                             void *result_handle,
-                             xen_result_func result_func);
-
-
-typedef struct
-{
-    xen_call_func call_func;
-    void *handle;
-    const char *session_id;
-    bool ok;
-    char **error_description;
-    int error_description_count;
-} xen_session;
-
-
-typedef struct xen_session_record
-{
-    char *uuid;
-    struct xen_host_record_opt *this_host;
-    char *this_user;
-    time_t last_active;
-} xen_session_record;
-
-
-/**
- * Allocate a xen_session_record.
- */
-extern xen_session_record *
-xen_session_record_alloc(void);
-
-
-/**
- * Free the given xen_session_record, and all referenced values.  The
- * given record must have been allocated by this library.
- */
-extern void
-xen_session_record_free(xen_session_record *record);
-
-
-struct xen_task_;
-typedef struct xen_task_ * xen_task_id;
-
-
-typedef struct
-{
-    int progress;
-    long eta;
-    /* !!! RESULT */
-}  xen_task_status;
-
-
-typedef struct
-{
-    int major;
-    int minor;
-    int patch;
-    char *extraversion;
-} xen_version;
-
-
-/**
- * Free the given xen_version, and all referenced values.
- */
-extern void xen_version_free(xen_version *version);
-
-
-/**
- * Return the version of this client-side library.  This will be the major,
- * minor, and extraversion of the Xen release with which it was released,
- * plus the library's own version as the patch.
- */
-extern xen_version *xen_get_client_side_version();
-
-
-extern bool
-xen_uuid_string_to_bytes(char *uuid, char **bytes);
-
-
-extern bool
-xen_uuid_bytes_to_string(char *bytes, char **uuid);
-
-
-extern void
-xen_uuid_free(char *uuid);
-
-
-extern void
-xen_uuid_bytes_free(char *bytes);
-
-
-/**
- * Initialise this library.  Call this before starting to use this library.
- * Note that since this library depends upon libxml2, you should also call
- * xmlInitParser as appropriate for your program.
- */
-extern
-void xen_init(void);
-
-
-/**
- * Clear up this library.  Call when you have finished using this library.
- * Note that since this library depends upon libxml2, you should also call
- * xmlCleanupParser as appropriate for your program.
- */
-extern
-void xen_fini(void);
-
-
-/**
- * Log in at the server, and allocate a xen_session to represent this session.
- */
-extern xen_session *
-xen_session_login_with_password(xen_call_func call_func, void *handle,
-                                const char *uname, const char *pwd);
-
-
-/**
- * Log out at the server, and free the xen_session.
- */
-extern void
-xen_session_logout(xen_session *session);
-
-
-/**
- * Clear any error condition recorded on this session.
- */
-void
-xen_session_clear_error(xen_session *session);
-
-
-/**
- * Get the UUID of the second given session.  Set *result to point at a
- * string, yours to free.
- */
-extern bool
-xen_session_get_uuid(xen_session *session, char **result,
-                     xen_session *self_session);
-
-
-/**
- * Get the this_host field of the second given session.  Set *result to be a
- * handle to that host.
- */
-extern bool
-xen_session_get_this_host(xen_session *session, xen_host *result,
-                          xen_session *self_session);
-
-
-/**
- * Get the this_user field of the second given session.  Set *result to point
- * at a string, yours to free.
- */
-extern bool
-xen_session_get_this_user(xen_session *session, char **result,
-                          xen_session *self_session);
-
-
-/**
- * Get the last_active field of the given session, and place it in *result.
- */
-extern bool
-xen_session_get_last_active(xen_session *session, time_t *result,
-                            xen_session *self_session);
-
-/**
- * Get a record containing the current state of the second given session.
- */
-extern bool
-xen_session_get_record(xen_session *session, xen_session_record **result,
-                       xen_session *self_session);
-
-
-#endif
diff --git a/tools/libxen/include/xen_console.h b/tools/libxen/include/xen_console.h
deleted file mode 100644 (file)
index 5402ae9..0000000
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_CONSOLE_H
-#define XEN_CONSOLE_H
-
-#include "xen_common.h"
-#include "xen_console_decl.h"
-#include "xen_console_protocol.h"
-#include "xen_string_string_map.h"
-#include "xen_vm_decl.h"
-
-
-/*
- * The console class.
- * 
- * A console.
- */
-
-
-/**
- * Free the given xen_console.  The given handle must have been
- * allocated by this library.
- */
-extern void
-xen_console_free(xen_console console);
-
-
-typedef struct xen_console_set
-{
-    size_t size;
-    xen_console *contents[];
-} xen_console_set;
-
-/**
- * Allocate a xen_console_set of the given size.
- */
-extern xen_console_set *
-xen_console_set_alloc(size_t size);
-
-/**
- * Free the given xen_console_set.  The given set must have been
- * allocated by this library.
- */
-extern void
-xen_console_set_free(xen_console_set *set);
-
-
-typedef struct xen_console_record
-{
-    xen_console handle;
-    char *uuid;
-    enum xen_console_protocol protocol;
-    char *location;
-    struct xen_vm_record_opt *vm;
-    xen_string_string_map *other_config;
-} xen_console_record;
-
-/**
- * Allocate a xen_console_record.
- */
-extern xen_console_record *
-xen_console_record_alloc(void);
-
-/**
- * Free the given xen_console_record, and all referenced values.  The
- * given record must have been allocated by this library.
- */
-extern void
-xen_console_record_free(xen_console_record *record);
-
-
-typedef struct xen_console_record_opt
-{
-    bool is_record;
-    union
-    {
-        xen_console handle;
-        xen_console_record *record;
-    } u;
-} xen_console_record_opt;
-
-/**
- * Allocate a xen_console_record_opt.
- */
-extern xen_console_record_opt *
-xen_console_record_opt_alloc(void);
-
-/**
- * Free the given xen_console_record_opt, and all referenced values. 
- * The given record_opt must have been allocated by this library.
- */
-extern void
-xen_console_record_opt_free(xen_console_record_opt *record_opt);
-
-
-typedef struct xen_console_record_set
-{
-    size_t size;
-    xen_console_record *contents[];
-} xen_console_record_set;
-
-/**
- * Allocate a xen_console_record_set of the given size.
- */
-extern xen_console_record_set *
-xen_console_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_console_record_set, and all referenced values. 
- * The given set must have been allocated by this library.
- */
-extern void
-xen_console_record_set_free(xen_console_record_set *set);
-
-
-
-typedef struct xen_console_record_opt_set
-{
-    size_t size;
-    xen_console_record_opt *contents[];
-} xen_console_record_opt_set;
-
-/**
- * Allocate a xen_console_record_opt_set of the given size.
- */
-extern xen_console_record_opt_set *
-xen_console_record_opt_set_alloc(size_t size);
-
-/**
- * Free the given xen_console_record_opt_set, and all referenced
- * values.  The given set must have been allocated by this library.
- */
-extern void
-xen_console_record_opt_set_free(xen_console_record_opt_set *set);
-
-
-/**
- * Get a record containing the current state of the given console.
- */
-extern bool
-xen_console_get_record(xen_session *session, xen_console_record **result, xen_console console);
-
-
-/**
- * Get a reference to the console instance with the specified UUID.
- */
-extern bool
-xen_console_get_by_uuid(xen_session *session, xen_console *result, char *uuid);
-
-
-/**
- * Create a new console instance, and return its handle.
- */
-extern bool
-xen_console_create(xen_session *session, xen_console *result, xen_console_record *record);
-
-
-/**
- * Destroy the specified console instance.
- */
-extern bool
-xen_console_destroy(xen_session *session, xen_console console);
-
-
-/**
- * Get the uuid field of the given console.
- */
-extern bool
-xen_console_get_uuid(xen_session *session, char **result, xen_console console);
-
-
-/**
- * Get the protocol field of the given console.
- */
-extern bool
-xen_console_get_protocol(xen_session *session, enum xen_console_protocol *result, xen_console console);
-
-
-/**
- * Get the location field of the given console.
- */
-extern bool
-xen_console_get_location(xen_session *session, char **result, xen_console console);
-
-
-/**
- * Get the VM field of the given console.
- */
-extern bool
-xen_console_get_vm(xen_session *session, xen_vm *result, xen_console console);
-
-
-/**
- * Get the other_config field of the given console.
- */
-extern bool
-xen_console_get_other_config(xen_session *session, xen_string_string_map **result, xen_console console);
-
-
-/**
- * Set the other_config field of the given console.
- */
-extern bool
-xen_console_set_other_config(xen_session *session, xen_console console, xen_string_string_map *other_config);
-
-
-/**
- * Add the given key-value pair to the other_config field of the given
- * console.
- */
-extern bool
-xen_console_add_to_other_config(xen_session *session, xen_console console, char *key, char *value);
-
-
-/**
- * Remove the given key and its corresponding value from the
- * other_config field of the given console.  If the key is not in that Map,
- * then do nothing.
- */
-extern bool
-xen_console_remove_from_other_config(xen_session *session, xen_console console, char *key);
-
-
-/**
- * Return a list of all the consoles known to the system.
- */
-extern bool
-xen_console_get_all(xen_session *session, struct xen_console_set **result);
-
-
-#endif
diff --git a/tools/libxen/include/xen_console_decl.h b/tools/libxen/include/xen_console_decl.h
deleted file mode 100644 (file)
index 1392164..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_CONSOLE_DECL_H
-#define XEN_CONSOLE_DECL_H
-
-typedef void *xen_console;
-
-struct xen_console_set;
-struct xen_console_record;
-struct xen_console_record_set;
-struct xen_console_record_opt;
-struct xen_console_record_opt_set;
-
-#endif
diff --git a/tools/libxen/include/xen_console_protocol.h b/tools/libxen/include/xen_console_protocol.h
deleted file mode 100644 (file)
index e6fcf62..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_CONSOLE_PROTOCOL_H
-#define XEN_CONSOLE_PROTOCOL_H
-
-
-#include "xen_common.h"
-
-
-enum xen_console_protocol
-{
-    /**
-     * VT100 terminal
-     */
-    XEN_CONSOLE_PROTOCOL_VT100,
-
-    /**
-     * Remote FrameBuffer protocol (as used in VNC)
-     */
-    XEN_CONSOLE_PROTOCOL_RFB,
-
-    /**
-     * Remote Desktop Protocol
-     */
-    XEN_CONSOLE_PROTOCOL_RDP
-};
-
-
-typedef struct xen_console_protocol_set
-{
-    size_t size;
-    enum xen_console_protocol contents[];
-} xen_console_protocol_set;
-
-/**
- * Allocate a xen_console_protocol_set of the given size.
- */
-extern xen_console_protocol_set *
-xen_console_protocol_set_alloc(size_t size);
-
-/**
- * Free the given xen_console_protocol_set.  The given set must have
- * been allocated by this library.
- */
-extern void
-xen_console_protocol_set_free(xen_console_protocol_set *set);
-
-
-/**
- * Return the name corresponding to the given code.  This string must
- * not be modified or freed.
- */
-extern const char *
-xen_console_protocol_to_string(enum xen_console_protocol val);
-
-
-/**
- * Return the correct code for the given string, or set the session
- * object to failure and return an undefined value if the given string does
- * not match a known code.
- */
-extern enum xen_console_protocol
-xen_console_protocol_from_string(xen_session *session, const char *str);
-
-
-#endif
index 70cdae37af9c03e24c09d0eaeba2bca11f0ea760..d2ddaa031964a3d1829d2335f484cc04bd6df518 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, XenSource Inc.
+ * Copyright (c) 2006-2007, XenSource Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
diff --git a/tools/libxen/include/xen_crashdump.h b/tools/libxen/include/xen_crashdump.h
deleted file mode 100644 (file)
index 00869db..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_CRASHDUMP_H
-#define XEN_CRASHDUMP_H
-
-#include "xen_common.h"
-#include "xen_crashdump_decl.h"
-#include "xen_vdi_decl.h"
-#include "xen_vm_decl.h"
-
-
-/*
- * The crashdump class.
- * 
- * A VM crashdump.
- */
-
-
-/**
- * Free the given xen_crashdump.  The given handle must have been
- * allocated by this library.
- */
-extern void
-xen_crashdump_free(xen_crashdump crashdump);
-
-
-typedef struct xen_crashdump_set
-{
-    size_t size;
-    xen_crashdump *contents[];
-} xen_crashdump_set;
-
-/**
- * Allocate a xen_crashdump_set of the given size.
- */
-extern xen_crashdump_set *
-xen_crashdump_set_alloc(size_t size);
-
-/**
- * Free the given xen_crashdump_set.  The given set must have been
- * allocated by this library.
- */
-extern void
-xen_crashdump_set_free(xen_crashdump_set *set);
-
-
-typedef struct xen_crashdump_record
-{
-    xen_crashdump handle;
-    char *uuid;
-    struct xen_vm_record_opt *vm;
-    struct xen_vdi_record_opt *vdi;
-} xen_crashdump_record;
-
-/**
- * Allocate a xen_crashdump_record.
- */
-extern xen_crashdump_record *
-xen_crashdump_record_alloc(void);
-
-/**
- * Free the given xen_crashdump_record, and all referenced values.  The
- * given record must have been allocated by this library.
- */
-extern void
-xen_crashdump_record_free(xen_crashdump_record *record);
-
-
-typedef struct xen_crashdump_record_opt
-{
-    bool is_record;
-    union
-    {
-        xen_crashdump handle;
-        xen_crashdump_record *record;
-    } u;
-} xen_crashdump_record_opt;
-
-/**
- * Allocate a xen_crashdump_record_opt.
- */
-extern xen_crashdump_record_opt *
-xen_crashdump_record_opt_alloc(void);
-
-/**
- * Free the given xen_crashdump_record_opt, and all referenced values. 
- * The given record_opt must have been allocated by this library.
- */
-extern void
-xen_crashdump_record_opt_free(xen_crashdump_record_opt *record_opt);
-
-
-typedef struct xen_crashdump_record_set
-{
-    size_t size;
-    xen_crashdump_record *contents[];
-} xen_crashdump_record_set;
-
-/**
- * Allocate a xen_crashdump_record_set of the given size.
- */
-extern xen_crashdump_record_set *
-xen_crashdump_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_crashdump_record_set, and all referenced values. 
- * The given set must have been allocated by this library.
- */
-extern void
-xen_crashdump_record_set_free(xen_crashdump_record_set *set);
-
-
-
-typedef struct xen_crashdump_record_opt_set
-{
-    size_t size;
-    xen_crashdump_record_opt *contents[];
-} xen_crashdump_record_opt_set;
-
-/**
- * Allocate a xen_crashdump_record_opt_set of the given size.
- */
-extern xen_crashdump_record_opt_set *
-xen_crashdump_record_opt_set_alloc(size_t size);
-
-/**
- * Free the given xen_crashdump_record_opt_set, and all referenced
- * values.  The given set must have been allocated by this library.
- */
-extern void
-xen_crashdump_record_opt_set_free(xen_crashdump_record_opt_set *set);
-
-
-/**
- * Get a record containing the current state of the given crashdump.
- */
-extern bool
-xen_crashdump_get_record(xen_session *session, xen_crashdump_record **result, xen_crashdump crashdump);
-
-
-/**
- * Get a reference to the crashdump instance with the specified UUID.
- */
-extern bool
-xen_crashdump_get_by_uuid(xen_session *session, xen_crashdump *result, char *uuid);
-
-
-/**
- * Get the uuid field of the given crashdump.
- */
-extern bool
-xen_crashdump_get_uuid(xen_session *session, char **result, xen_crashdump crashdump);
-
-
-/**
- * Get the VM field of the given crashdump.
- */
-extern bool
-xen_crashdump_get_vm(xen_session *session, xen_vm *result, xen_crashdump crashdump);
-
-
-/**
- * Get the VDI field of the given crashdump.
- */
-extern bool
-xen_crashdump_get_vdi(xen_session *session, xen_vdi *result, xen_crashdump crashdump);
-
-
-/**
- * Destroy the specified crashdump
- */
-extern bool
-xen_crashdump_destroy(xen_session *session, xen_crashdump self);
-
-
-/**
- * Return a list of all the crashdumps known to the system.
- */
-extern bool
-xen_crashdump_get_all(xen_session *session, struct xen_crashdump_set **result);
-
-
-#endif
diff --git a/tools/libxen/include/xen_crashdump_decl.h b/tools/libxen/include/xen_crashdump_decl.h
deleted file mode 100644 (file)
index 3087715..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_CRASHDUMP_DECL_H
-#define XEN_CRASHDUMP_DECL_H
-
-typedef void *xen_crashdump;
-
-struct xen_crashdump_set;
-struct xen_crashdump_record;
-struct xen_crashdump_record_set;
-struct xen_crashdump_record_opt;
-struct xen_crashdump_record_opt_set;
-
-#endif
diff --git a/tools/libxen/include/xen_event.h b/tools/libxen/include/xen_event.h
deleted file mode 100644 (file)
index 1e171b8..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_EVENT_H
-#define XEN_EVENT_H
-
-#include "xen_common.h"
-#include "xen_event_decl.h"
-#include "xen_event_operation.h"
-#include "xen_string_set.h"
-
-
-/*
- * The event class.
- * 
- * Asynchronous event registration and handling.
- */
-
-
-
-typedef struct xen_event_record
-{
-    int64_t id;
-    time_t timestamp;
-    char *class;
-    enum xen_event_operation operation;
-    char *ref;
-    char *obj_uuid;
-} xen_event_record;
-
-/**
- * Allocate a xen_event_record.
- */
-extern xen_event_record *
-xen_event_record_alloc(void);
-
-/**
- * Free the given xen_event_record, and all referenced values.  The
- * given record must have been allocated by this library.
- */
-extern void
-xen_event_record_free(xen_event_record *record);
-
-
-typedef struct xen_event_record_set
-{
-    size_t size;
-    xen_event_record *contents[];
-} xen_event_record_set;
-
-/**
- * Allocate a xen_event_record_set of the given size.
- */
-extern xen_event_record_set *
-xen_event_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_event_record_set, and all referenced values.  The
- * given set must have been allocated by this library.
- */
-extern void
-xen_event_record_set_free(xen_event_record_set *set);
-
-
-/**
- * Registers this session with the event system.  Specifying the empty
- * list will register for all classes.
- */
-extern bool
-xen_event_register(xen_session *session, struct xen_string_set *classes);
-
-
-/**
- * Unregisters this session with the event system.
- */
-extern bool
-xen_event_unregister(xen_session *session, struct xen_string_set *classes);
-
-
-/**
- * Blocking call which returns a (possibly empty) batch of events.
- */
-extern bool
-xen_event_next(xen_session *session, struct xen_event_record_set **result);
-
-
-#endif
diff --git a/tools/libxen/include/xen_event_decl.h b/tools/libxen/include/xen_event_decl.h
deleted file mode 100644 (file)
index 856991f..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_EVENT_DECL_H
-#define XEN_EVENT_DECL_H
-
-struct xen_event_record;
-struct xen_event_record_set;
-
-#endif
diff --git a/tools/libxen/include/xen_event_operation.h b/tools/libxen/include/xen_event_operation.h
deleted file mode 100644 (file)
index 05319ef..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_EVENT_OPERATION_H
-#define XEN_EVENT_OPERATION_H
-
-
-#include "xen_common.h"
-
-
-enum xen_event_operation
-{
-    /**
-     * An object has been created
-     */
-    XEN_EVENT_OPERATION_ADD,
-
-    /**
-     * An object has been deleted
-     */
-    XEN_EVENT_OPERATION_DEL,
-
-    /**
-     * An object has been modified
-     */
-    XEN_EVENT_OPERATION_MOD
-};
-
-
-typedef struct xen_event_operation_set
-{
-    size_t size;
-    enum xen_event_operation contents[];
-} xen_event_operation_set;
-
-/**
- * Allocate a xen_event_operation_set of the given size.
- */
-extern xen_event_operation_set *
-xen_event_operation_set_alloc(size_t size);
-
-/**
- * Free the given xen_event_operation_set.  The given set must have
- * been allocated by this library.
- */
-extern void
-xen_event_operation_set_free(xen_event_operation_set *set);
-
-
-/**
- * Return the name corresponding to the given code.  This string must
- * not be modified or freed.
- */
-extern const char *
-xen_event_operation_to_string(enum xen_event_operation val);
-
-
-/**
- * Return the correct code for the given string, or set the session
- * object to failure and return an undefined value if the given string does
- * not match a known code.
- */
-extern enum xen_event_operation
-xen_event_operation_from_string(xen_session *session, const char *str);
-
-
-#endif
diff --git a/tools/libxen/include/xen_host.h b/tools/libxen/include/xen_host.h
deleted file mode 100644 (file)
index cb2c447..0000000
+++ /dev/null
@@ -1,497 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_HOST_H
-#define XEN_HOST_H
-
-#include "xen_common.h"
-#include "xen_host_cpu_decl.h"
-#include "xen_host_decl.h"
-#include "xen_host_metrics_decl.h"
-#include "xen_pbd_decl.h"
-#include "xen_pif_decl.h"
-#include "xen_sr_decl.h"
-#include "xen_string_set.h"
-#include "xen_string_string_map.h"
-#include "xen_vm_decl.h"
-
-
-/*
- * The host class.
- * 
- * A physical host.
- */
-
-
-/**
- * Free the given xen_host.  The given handle must have been allocated
- * by this library.
- */
-extern void
-xen_host_free(xen_host host);
-
-
-typedef struct xen_host_set
-{
-    size_t size;
-    xen_host *contents[];
-} xen_host_set;
-
-/**
- * Allocate a xen_host_set of the given size.
- */
-extern xen_host_set *
-xen_host_set_alloc(size_t size);
-
-/**
- * Free the given xen_host_set.  The given set must have been allocated
- * by this library.
- */
-extern void
-xen_host_set_free(xen_host_set *set);
-
-
-typedef struct xen_host_record
-{
-    xen_host handle;
-    char *uuid;
-    char *name_label;
-    char *name_description;
-    int64_t api_version_major;
-    int64_t api_version_minor;
-    char *api_version_vendor;
-    xen_string_string_map *api_version_vendor_implementation;
-    bool enabled;
-    xen_string_string_map *software_version;
-    xen_string_string_map *other_config;
-    struct xen_string_set *capabilities;
-    xen_string_string_map *cpu_configuration;
-    char *sched_policy;
-    struct xen_string_set *supported_bootloaders;
-    struct xen_vm_record_opt_set *resident_vms;
-    xen_string_string_map *logging;
-    struct xen_pif_record_opt_set *pifs;
-    struct xen_sr_record_opt *suspend_image_sr;
-    struct xen_sr_record_opt *crash_dump_sr;
-    struct xen_pbd_record_opt_set *pbds;
-    struct xen_host_cpu_record_opt_set *host_cpus;
-    struct xen_host_metrics_record_opt *metrics;
-} xen_host_record;
-
-/**
- * Allocate a xen_host_record.
- */
-extern xen_host_record *
-xen_host_record_alloc(void);
-
-/**
- * Free the given xen_host_record, and all referenced values.  The
- * given record must have been allocated by this library.
- */
-extern void
-xen_host_record_free(xen_host_record *record);
-
-
-typedef struct xen_host_record_opt
-{
-    bool is_record;
-    union
-    {
-        xen_host handle;
-        xen_host_record *record;
-    } u;
-} xen_host_record_opt;
-
-/**
- * Allocate a xen_host_record_opt.
- */
-extern xen_host_record_opt *
-xen_host_record_opt_alloc(void);
-
-/**
- * Free the given xen_host_record_opt, and all referenced values.  The
- * given record_opt must have been allocated by this library.
- */
-extern void
-xen_host_record_opt_free(xen_host_record_opt *record_opt);
-
-
-typedef struct xen_host_record_set
-{
-    size_t size;
-    xen_host_record *contents[];
-} xen_host_record_set;
-
-/**
- * Allocate a xen_host_record_set of the given size.
- */
-extern xen_host_record_set *
-xen_host_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_host_record_set, and all referenced values.  The
- * given set must have been allocated by this library.
- */
-extern void
-xen_host_record_set_free(xen_host_record_set *set);
-
-
-
-typedef struct xen_host_record_opt_set
-{
-    size_t size;
-    xen_host_record_opt *contents[];
-} xen_host_record_opt_set;
-
-/**
- * Allocate a xen_host_record_opt_set of the given size.
- */
-extern xen_host_record_opt_set *
-xen_host_record_opt_set_alloc(size_t size);
-
-/**
- * Free the given xen_host_record_opt_set, and all referenced values. 
- * The given set must have been allocated by this library.
- */
-extern void
-xen_host_record_opt_set_free(xen_host_record_opt_set *set);
-
-
-/**
- * Get a record containing the current state of the given host.
- */
-extern bool
-xen_host_get_record(xen_session *session, xen_host_record **result, xen_host host);
-
-
-/**
- * Get a reference to the host instance with the specified UUID.
- */
-extern bool
-xen_host_get_by_uuid(xen_session *session, xen_host *result, char *uuid);
-
-
-/**
- * Get all the host instances with the given label.
- */
-extern bool
-xen_host_get_by_name_label(xen_session *session, struct xen_host_set **result, char *label);
-
-
-/**
- * Get the uuid field of the given host.
- */
-extern bool
-xen_host_get_uuid(xen_session *session, char **result, xen_host host);
-
-
-/**
- * Get the name/label field of the given host.
- */
-extern bool
-xen_host_get_name_label(xen_session *session, char **result, xen_host host);
-
-
-/**
- * Get the name/description field of the given host.
- */
-extern bool
-xen_host_get_name_description(xen_session *session, char **result, xen_host host);
-
-
-/**
- * Get the API_version/major field of the given host.
- */
-extern bool
-xen_host_get_api_version_major(xen_session *session, int64_t *result, xen_host host);
-
-
-/**
- * Get the API_version/minor field of the given host.
- */
-extern bool
-xen_host_get_api_version_minor(xen_session *session, int64_t *result, xen_host host);
-
-
-/**
- * Get the API_version/vendor field of the given host.
- */
-extern bool
-xen_host_get_api_version_vendor(xen_session *session, char **result, xen_host host);
-
-
-/**
- * Get the API_version/vendor_implementation field of the given host.
- */
-extern bool
-xen_host_get_api_version_vendor_implementation(xen_session *session, xen_string_string_map **result, xen_host host);
-
-
-/**
- * Get the enabled field of the given host.
- */
-extern bool
-xen_host_get_enabled(xen_session *session, bool *result, xen_host host);
-
-
-/**
- * Get the software_version field of the given host.
- */
-extern bool
-xen_host_get_software_version(xen_session *session, xen_string_string_map **result, xen_host host);
-
-
-/**
- * Get the other_config field of the given host.
- */
-extern bool
-xen_host_get_other_config(xen_session *session, xen_string_string_map **result, xen_host host);
-
-
-/**
- * Get the capabilities field of the given host.
- */
-extern bool
-xen_host_get_capabilities(xen_session *session, struct xen_string_set **result, xen_host host);
-
-
-/**
- * Get the cpu_configuration field of the given host.
- */
-extern bool
-xen_host_get_cpu_configuration(xen_session *session, xen_string_string_map **result, xen_host host);
-
-
-/**
- * Get the sched_policy field of the given host.
- */
-extern bool
-xen_host_get_sched_policy(xen_session *session, char **result, xen_host host);
-
-
-/**
- * Get the supported_bootloaders field of the given host.
- */
-extern bool
-xen_host_get_supported_bootloaders(xen_session *session, struct xen_string_set **result, xen_host host);
-
-
-/**
- * Get the resident_VMs field of the given host.
- */
-extern bool
-xen_host_get_resident_vms(xen_session *session, struct xen_vm_set **result, xen_host host);
-
-
-/**
- * Get the logging field of the given host.
- */
-extern bool
-xen_host_get_logging(xen_session *session, xen_string_string_map **result, xen_host host);
-
-
-/**
- * Get the PIFs field of the given host.
- */
-extern bool
-xen_host_get_pifs(xen_session *session, struct xen_pif_set **result, xen_host host);
-
-
-/**
- * Get the suspend_image_sr field of the given host.
- */
-extern bool
-xen_host_get_suspend_image_sr(xen_session *session, xen_sr *result, xen_host host);
-
-
-/**
- * Get the crash_dump_sr field of the given host.
- */
-extern bool
-xen_host_get_crash_dump_sr(xen_session *session, xen_sr *result, xen_host host);
-
-
-/**
- * Get the PBDs field of the given host.
- */
-extern bool
-xen_host_get_pbds(xen_session *session, struct xen_pbd_set **result, xen_host host);
-
-
-/**
- * Get the host_CPUs field of the given host.
- */
-extern bool
-xen_host_get_host_cpus(xen_session *session, struct xen_host_cpu_set **result, xen_host host);
-
-
-/**
- * Get the metrics field of the given host.
- */
-extern bool
-xen_host_get_metrics(xen_session *session, xen_host_metrics *result, xen_host host);
-
-
-/**
- * Set the name/label field of the given host.
- */
-extern bool
-xen_host_set_name_label(xen_session *session, xen_host host, char *label);
-
-
-/**
- * Set the name/description field of the given host.
- */
-extern bool
-xen_host_set_name_description(xen_session *session, xen_host host, char *description);
-
-
-/**
- * Set the other_config field of the given host.
- */
-extern bool
-xen_host_set_other_config(xen_session *session, xen_host host, xen_string_string_map *other_config);
-
-
-/**
- * Add the given key-value pair to the other_config field of the given
- * host.
- */
-extern bool
-xen_host_add_to_other_config(xen_session *session, xen_host host, char *key, char *value);
-
-
-/**
- * Remove the given key and its corresponding value from the
- * other_config field of the given host.  If the key is not in that Map, then
- * do nothing.
- */
-extern bool
-xen_host_remove_from_other_config(xen_session *session, xen_host host, char *key);
-
-
-/**
- * Set the logging field of the given host.
- */
-extern bool
-xen_host_set_logging(xen_session *session, xen_host host, xen_string_string_map *logging);
-
-
-/**
- * Add the given key-value pair to the logging field of the given host.
- */
-extern bool
-xen_host_add_to_logging(xen_session *session, xen_host host, char *key, char *value);
-
-
-/**
- * Remove the given key and its corresponding value from the logging
- * field of the given host.  If the key is not in that Map, then do nothing.
- */
-extern bool
-xen_host_remove_from_logging(xen_session *session, xen_host host, char *key);
-
-
-/**
- * Set the suspend_image_sr field of the given host.
- */
-extern bool
-xen_host_set_suspend_image_sr(xen_session *session, xen_host host, xen_sr suspend_image_sr);
-
-
-/**
- * Set the crash_dump_sr field of the given host.
- */
-extern bool
-xen_host_set_crash_dump_sr(xen_session *session, xen_host host, xen_sr crash_dump_sr);
-
-
-/**
- * Puts the host into a state in which no new VMs can be started.
- * Currently active VMs on the host continue to execute.
- */
-extern bool
-xen_host_disable(xen_session *session, xen_host host);
-
-
-/**
- * Puts the host into a state in which new VMs can be started.
- */
-extern bool
-xen_host_enable(xen_session *session, xen_host host);
-
-
-/**
- * Shutdown the host. (This function can only be called if there are no
- * currently running VMs on the host and it is disabled.).
- */
-extern bool
-xen_host_shutdown(xen_session *session, xen_host host);
-
-
-/**
- * Reboot the host. (This function can only be called if there are no
- * currently running VMs on the host and it is disabled.).
- */
-extern bool
-xen_host_reboot(xen_session *session, xen_host host);
-
-
-/**
- * Get the host xen dmesg.
- */
-extern bool
-xen_host_dmesg(xen_session *session, char **result, xen_host host);
-
-
-/**
- * Get the host xen dmesg, and clear the buffer.
- */
-extern bool
-xen_host_dmesg_clear(xen_session *session, char **result, xen_host host);
-
-
-/**
- * Get the host's log file.
- */
-extern bool
-xen_host_get_log(xen_session *session, char **result, xen_host host);
-
-
-/**
- * Inject the given string as debugging keys into Xen.
- */
-extern bool
-xen_host_send_debug_keys(xen_session *session, xen_host host, char *keys);
-
-
-/**
- * List all supported methods.
- */
-extern bool
-xen_host_list_methods(xen_session *session, struct xen_string_set **result);
-
-
-/**
- * Return a list of all the hosts known to the system.
- */
-extern bool
-xen_host_get_all(xen_session *session, struct xen_host_set **result);
-
-
-#endif
diff --git a/tools/libxen/include/xen_host_cpu.h b/tools/libxen/include/xen_host_cpu.h
deleted file mode 100644 (file)
index b484793..0000000
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_HOST_CPU_H
-#define XEN_HOST_CPU_H
-
-#include "xen_common.h"
-#include "xen_host_cpu_decl.h"
-#include "xen_host_decl.h"
-
-
-/*
- * The host_cpu class.
- * 
- * A physical CPU.
- */
-
-
-/**
- * Free the given xen_host_cpu.  The given handle must have been
- * allocated by this library.
- */
-extern void
-xen_host_cpu_free(xen_host_cpu host_cpu);
-
-
-typedef struct xen_host_cpu_set
-{
-    size_t size;
-    xen_host_cpu *contents[];
-} xen_host_cpu_set;
-
-/**
- * Allocate a xen_host_cpu_set of the given size.
- */
-extern xen_host_cpu_set *
-xen_host_cpu_set_alloc(size_t size);
-
-/**
- * Free the given xen_host_cpu_set.  The given set must have been
- * allocated by this library.
- */
-extern void
-xen_host_cpu_set_free(xen_host_cpu_set *set);
-
-
-typedef struct xen_host_cpu_record
-{
-    xen_host_cpu handle;
-    char *uuid;
-    struct xen_host_record_opt *host;
-    int64_t number;
-    char *vendor;
-    int64_t speed;
-    char *modelname;
-    char *stepping;
-    char *flags;
-    char *features;
-    double utilisation;
-} xen_host_cpu_record;
-
-/**
- * Allocate a xen_host_cpu_record.
- */
-extern xen_host_cpu_record *
-xen_host_cpu_record_alloc(void);
-
-/**
- * Free the given xen_host_cpu_record, and all referenced values.  The
- * given record must have been allocated by this library.
- */
-extern void
-xen_host_cpu_record_free(xen_host_cpu_record *record);
-
-
-typedef struct xen_host_cpu_record_opt
-{
-    bool is_record;
-    union
-    {
-        xen_host_cpu handle;
-        xen_host_cpu_record *record;
-    } u;
-} xen_host_cpu_record_opt;
-
-/**
- * Allocate a xen_host_cpu_record_opt.
- */
-extern xen_host_cpu_record_opt *
-xen_host_cpu_record_opt_alloc(void);
-
-/**
- * Free the given xen_host_cpu_record_opt, and all referenced values. 
- * The given record_opt must have been allocated by this library.
- */
-extern void
-xen_host_cpu_record_opt_free(xen_host_cpu_record_opt *record_opt);
-
-
-typedef struct xen_host_cpu_record_set
-{
-    size_t size;
-    xen_host_cpu_record *contents[];
-} xen_host_cpu_record_set;
-
-/**
- * Allocate a xen_host_cpu_record_set of the given size.
- */
-extern xen_host_cpu_record_set *
-xen_host_cpu_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_host_cpu_record_set, and all referenced values. 
- * The given set must have been allocated by this library.
- */
-extern void
-xen_host_cpu_record_set_free(xen_host_cpu_record_set *set);
-
-
-
-typedef struct xen_host_cpu_record_opt_set
-{
-    size_t size;
-    xen_host_cpu_record_opt *contents[];
-} xen_host_cpu_record_opt_set;
-
-/**
- * Allocate a xen_host_cpu_record_opt_set of the given size.
- */
-extern xen_host_cpu_record_opt_set *
-xen_host_cpu_record_opt_set_alloc(size_t size);
-
-/**
- * Free the given xen_host_cpu_record_opt_set, and all referenced
- * values.  The given set must have been allocated by this library.
- */
-extern void
-xen_host_cpu_record_opt_set_free(xen_host_cpu_record_opt_set *set);
-
-
-/**
- * Get a record containing the current state of the given host_cpu.
- */
-extern bool
-xen_host_cpu_get_record(xen_session *session, xen_host_cpu_record **result, xen_host_cpu host_cpu);
-
-
-/**
- * Get a reference to the host_cpu instance with the specified UUID.
- */
-extern bool
-xen_host_cpu_get_by_uuid(xen_session *session, xen_host_cpu *result, char *uuid);
-
-
-/**
- * Get the uuid field of the given host_cpu.
- */
-extern bool
-xen_host_cpu_get_uuid(xen_session *session, char **result, xen_host_cpu host_cpu);
-
-
-/**
- * Get the host field of the given host_cpu.
- */
-extern bool
-xen_host_cpu_get_host(xen_session *session, xen_host *result, xen_host_cpu host_cpu);
-
-
-/**
- * Get the number field of the given host_cpu.
- */
-extern bool
-xen_host_cpu_get_number(xen_session *session, int64_t *result, xen_host_cpu host_cpu);
-
-
-/**
- * Get the vendor field of the given host_cpu.
- */
-extern bool
-xen_host_cpu_get_vendor(xen_session *session, char **result, xen_host_cpu host_cpu);
-
-
-/**
- * Get the speed field of the given host_cpu.
- */
-extern bool
-xen_host_cpu_get_speed(xen_session *session, int64_t *result, xen_host_cpu host_cpu);
-
-
-/**
- * Get the modelname field of the given host_cpu.
- */
-extern bool
-xen_host_cpu_get_modelname(xen_session *session, char **result, xen_host_cpu host_cpu);
-
-
-/**
- * Get the stepping field of the given host_cpu.
- */
-extern bool
-xen_host_cpu_get_stepping(xen_session *session, char **result, xen_host_cpu host_cpu);
-
-
-/**
- * Get the flags field of the given host_cpu.
- */
-extern bool
-xen_host_cpu_get_flags(xen_session *session, char **result, xen_host_cpu host_cpu);
-
-
-/**
- * Get the features field of the given host_cpu.
- */
-extern bool
-xen_host_cpu_get_features(xen_session *session, char **result, xen_host_cpu host_cpu);
-
-
-/**
- * Get the utilisation field of the given host_cpu.
- */
-extern bool
-xen_host_cpu_get_utilisation(xen_session *session, double *result, xen_host_cpu host_cpu);
-
-
-/**
- * Return a list of all the host_cpus known to the system.
- */
-extern bool
-xen_host_cpu_get_all(xen_session *session, struct xen_host_cpu_set **result);
-
-
-#endif
diff --git a/tools/libxen/include/xen_host_cpu_decl.h b/tools/libxen/include/xen_host_cpu_decl.h
deleted file mode 100644 (file)
index 1d24953..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_HOST_CPU_DECL_H
-#define XEN_HOST_CPU_DECL_H
-
-typedef void *xen_host_cpu;
-
-struct xen_host_cpu_set;
-struct xen_host_cpu_record;
-struct xen_host_cpu_record_set;
-struct xen_host_cpu_record_opt;
-struct xen_host_cpu_record_opt_set;
-
-#endif
diff --git a/tools/libxen/include/xen_host_decl.h b/tools/libxen/include/xen_host_decl.h
deleted file mode 100644 (file)
index affb676..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_HOST_DECL_H
-#define XEN_HOST_DECL_H
-
-typedef void *xen_host;
-
-struct xen_host_set;
-struct xen_host_record;
-struct xen_host_record_set;
-struct xen_host_record_opt;
-struct xen_host_record_opt_set;
-
-#endif
diff --git a/tools/libxen/include/xen_host_metrics.h b/tools/libxen/include/xen_host_metrics.h
deleted file mode 100644 (file)
index 8412133..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_HOST_METRICS_H
-#define XEN_HOST_METRICS_H
-
-#include "xen_common.h"
-#include "xen_host_metrics_decl.h"
-
-
-/*
- * The host_metrics class.
- * 
- * The metrics associated with a host.
- */
-
-
-/**
- * Free the given xen_host_metrics.  The given handle must have been
- * allocated by this library.
- */
-extern void
-xen_host_metrics_free(xen_host_metrics host_metrics);
-
-
-typedef struct xen_host_metrics_set
-{
-    size_t size;
-    xen_host_metrics *contents[];
-} xen_host_metrics_set;
-
-/**
- * Allocate a xen_host_metrics_set of the given size.
- */
-extern xen_host_metrics_set *
-xen_host_metrics_set_alloc(size_t size);
-
-/**
- * Free the given xen_host_metrics_set.  The given set must have been
- * allocated by this library.
- */
-extern void
-xen_host_metrics_set_free(xen_host_metrics_set *set);
-
-
-typedef struct xen_host_metrics_record
-{
-    xen_host_metrics handle;
-    char *uuid;
-    int64_t memory_total;
-    int64_t memory_free;
-    time_t last_updated;
-} xen_host_metrics_record;
-
-/**
- * Allocate a xen_host_metrics_record.
- */
-extern xen_host_metrics_record *
-xen_host_metrics_record_alloc(void);
-
-/**
- * Free the given xen_host_metrics_record, and all referenced values. 
- * The given record must have been allocated by this library.
- */
-extern void
-xen_host_metrics_record_free(xen_host_metrics_record *record);
-
-
-typedef struct xen_host_metrics_record_opt
-{
-    bool is_record;
-    union
-    {
-        xen_host_metrics handle;
-        xen_host_metrics_record *record;
-    } u;
-} xen_host_metrics_record_opt;
-
-/**
- * Allocate a xen_host_metrics_record_opt.
- */
-extern xen_host_metrics_record_opt *
-xen_host_metrics_record_opt_alloc(void);
-
-/**
- * Free the given xen_host_metrics_record_opt, and all referenced
- * values.  The given record_opt must have been allocated by this library.
- */
-extern void
-xen_host_metrics_record_opt_free(xen_host_metrics_record_opt *record_opt);
-
-
-typedef struct xen_host_metrics_record_set
-{
-    size_t size;
-    xen_host_metrics_record *contents[];
-} xen_host_metrics_record_set;
-
-/**
- * Allocate a xen_host_metrics_record_set of the given size.
- */
-extern xen_host_metrics_record_set *
-xen_host_metrics_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_host_metrics_record_set, and all referenced
- * values.  The given set must have been allocated by this library.
- */
-extern void
-xen_host_metrics_record_set_free(xen_host_metrics_record_set *set);
-
-
-
-typedef struct xen_host_metrics_record_opt_set
-{
-    size_t size;
-    xen_host_metrics_record_opt *contents[];
-} xen_host_metrics_record_opt_set;
-
-/**
- * Allocate a xen_host_metrics_record_opt_set of the given size.
- */
-extern xen_host_metrics_record_opt_set *
-xen_host_metrics_record_opt_set_alloc(size_t size);
-
-/**
- * Free the given xen_host_metrics_record_opt_set, and all referenced
- * values.  The given set must have been allocated by this library.
- */
-extern void
-xen_host_metrics_record_opt_set_free(xen_host_metrics_record_opt_set *set);
-
-
-/**
- * Get a record containing the current state of the given host_metrics.
- */
-extern bool
-xen_host_metrics_get_record(xen_session *session, xen_host_metrics_record **result, xen_host_metrics host_metrics);
-
-
-/**
- * Get a reference to the host_metrics instance with the specified
- * UUID.
- */
-extern bool
-xen_host_metrics_get_by_uuid(xen_session *session, xen_host_metrics *result, char *uuid);
-
-
-/**
- * Get the uuid field of the given host_metrics.
- */
-extern bool
-xen_host_metrics_get_uuid(xen_session *session, char **result, xen_host_metrics host_metrics);
-
-
-/**
- * Get the memory/total field of the given host_metrics.
- */
-extern bool
-xen_host_metrics_get_memory_total(xen_session *session, int64_t *result, xen_host_metrics host_metrics);
-
-
-/**
- * Get the memory/free field of the given host_metrics.
- */
-extern bool
-xen_host_metrics_get_memory_free(xen_session *session, int64_t *result, xen_host_metrics host_metrics);
-
-
-/**
- * Get the last_updated field of the given host_metrics.
- */
-extern bool
-xen_host_metrics_get_last_updated(xen_session *session, time_t *result, xen_host_metrics host_metrics);
-
-
-/**
- * Return a list of all the host_metrics instances known to the system.
- */
-extern bool
-xen_host_metrics_get_all(xen_session *session, struct xen_host_metrics_set **result);
-
-
-#endif
diff --git a/tools/libxen/include/xen_host_metrics_decl.h b/tools/libxen/include/xen_host_metrics_decl.h
deleted file mode 100644 (file)
index e913716..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_HOST_METRICS_DECL_H
-#define XEN_HOST_METRICS_DECL_H
-
-typedef void *xen_host_metrics;
-
-struct xen_host_metrics_set;
-struct xen_host_metrics_record;
-struct xen_host_metrics_record_set;
-struct xen_host_metrics_record_opt;
-struct xen_host_metrics_record_opt_set;
-
-#endif
diff --git a/tools/libxen/include/xen_int_float_map.h b/tools/libxen/include/xen_int_float_map.h
deleted file mode 100644 (file)
index 9cc4769..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_INT_FLOAT_MAP_H
-#define XEN_INT_FLOAT_MAP_H
-
-
-#include "xen_common.h"
-
-
-typedef struct xen_int_float_map_contents
-{
-  int64_t key;
-  double val;
-} xen_int_float_map_contents;
-
-
-typedef struct xen_int_float_map
-{
-    size_t size;
-    xen_int_float_map_contents contents[];
-} xen_int_float_map;
-
-/**
- * Allocate a xen_int_float_map of the given size.
- */
-extern xen_int_float_map *
-xen_int_float_map_alloc(size_t size);
-
-/**
- * Free the given xen_int_float_map, and all referenced values.  The
- * given map must have been allocated by this library.
- */
-extern void
-xen_int_float_map_free(xen_int_float_map *map);
-
-
-#endif
diff --git a/tools/libxen/include/xen_int_int_map.h b/tools/libxen/include/xen_int_int_map.h
deleted file mode 100644 (file)
index 5d11e14..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_INT_INT_MAP_H
-#define XEN_INT_INT_MAP_H
-
-
-#include "xen_common.h"
-
-
-typedef struct xen_int_int_map_contents
-{
-  int64_t key;
-  int64_t val;
-} xen_int_int_map_contents;
-
-
-typedef struct xen_int_int_map
-{
-    size_t size;
-    xen_int_int_map_contents contents[];
-} xen_int_int_map;
-
-/**
- * Allocate a xen_int_int_map of the given size.
- */
-extern xen_int_int_map *
-xen_int_int_map_alloc(size_t size);
-
-/**
- * Free the given xen_int_int_map, and all referenced values.  The
- * given map must have been allocated by this library.
- */
-extern void
-xen_int_int_map_free(xen_int_int_map *map);
-
-
-#endif
diff --git a/tools/libxen/include/xen_int_string_set_map.h b/tools/libxen/include/xen_int_string_set_map.h
deleted file mode 100644 (file)
index 7a784fd..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_INT_STRING_SET_MAP_H
-#define XEN_INT_STRING_SET_MAP_H
-
-
-#include "xen_common.h"
-
-
-typedef struct xen_int_string_set_map_contents
-{
-  int64_t key;
-  struct xen_string_set *val;
-} xen_int_string_set_map_contents;
-
-
-typedef struct xen_int_string_set_map
-{
-    size_t size;
-    xen_int_string_set_map_contents contents[];
-} xen_int_string_set_map;
-
-/**
- * Allocate a xen_int_string_set_map of the given size.
- */
-extern xen_int_string_set_map *
-xen_int_string_set_map_alloc(size_t size);
-
-/**
- * Free the given xen_int_string_set_map, and all referenced values. 
- * The given map must have been allocated by this library.
- */
-extern void
-xen_int_string_set_map_free(xen_int_string_set_map *map);
-
-
-#endif
index ea326b29de3554765ce2bb5de4395cc30bcc68c1..21f75de5fecdd94862586ef9f3a417589642bfd1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006 XenSource, Inc.
+ * Copyright (c) 2006-2007 XenSource, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -24,7 +24,7 @@
 #include <stdbool.h>
 #include <stdlib.h>
 
-#include "xen_common.h"
+#include <xen/api/xen_common.h>
 
 
 enum abstract_typename
@@ -147,7 +147,12 @@ type__ ## _free(type__ handle)                  \
 }                                               \
 
 
-#define XEN_SET_ALLOC_FREE(type__)                                      \
+#define XEN_SET_ALLOC_FREE(type__)              \
+    XEN_SET_ALLOC(type__)                       \
+    XEN_SET_FREE(type__)
+
+
+#define XEN_SET_ALLOC(type__)                                           \
 type__ ## _set *                                                        \
 type__ ## _set_alloc(size_t size)                                       \
 {                                                                       \
@@ -155,43 +160,29 @@ type__ ## _set_alloc(size_t size)                                       \
                                     size * sizeof(type__));             \
     result->size = size;                                                \
     return result;                                                      \
-}                                                                       \
-                                                                        \
-void                                                                    \
-type__ ## _set_free(type__ ## _set *set)                                \
+}
+
+
+#define XEN_SET_FREE(type__)                                            \
+void type__ ## _set_free(type__ ## _set *set)                           \
 {                                                                       \
     if (set == NULL)                                                    \
-    {                                                                   \
         return;                                                         \
-    }                                                                   \
-    size_t n = set->size;                                               \
-    for (size_t i = 0; i < n; i++)                                      \
-    {                                                                   \
+    for (size_t i = 0; i < set->size; i++)                              \
        type__ ## _free(set->contents[i]);                               \
-    }                                                                   \
-                                                                        \
     free(set);                                                          \
-}                                                                       \
-
-
-#define XEN_RECORD_OPT_FREE(type__)                     \
-void                                                    \
-type__ ## _record_opt_free(type__ ## _record_opt *opt)  \
-{                                                       \
-    if (opt == NULL)                                    \
-    {                                                   \
-        return;                                         \
-    }                                                   \
-    if (opt->is_record)                                 \
-    {                                                   \
-        type__ ## _record_free(opt->u.record);          \
-    }                                                   \
-    else                                                \
-    {                                                   \
-        type__ ## _free(opt->u.handle);                 \
-    }                                                   \
-    free(opt);                                          \
-}                                                       \
+}
+
+
+#define XEN_RECORD_OPT_FREE(type__)                                     \
+void type__ ## _record_opt_free(type__ ## _record_opt *opt) {           \
+    if (opt == NULL) return;                                            \
+    if (opt->is_record)                                                 \
+        type__ ## _record_free(opt->u.record);                          \
+    else                                                                \
+        type__ ## _free(opt->u.handle);                                 \
+    free(opt);                                                          \
+}
 
 
 #endif
diff --git a/tools/libxen/include/xen_network.h b/tools/libxen/include/xen_network.h
deleted file mode 100644 (file)
index 988495f..0000000
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_NETWORK_H
-#define XEN_NETWORK_H
-
-#include "xen_common.h"
-#include "xen_network_decl.h"
-#include "xen_pif_decl.h"
-#include "xen_string_string_map.h"
-#include "xen_vif_decl.h"
-
-
-/*
- * The network class.
- * 
- * A virtual network.
- */
-
-
-/**
- * Free the given xen_network.  The given handle must have been
- * allocated by this library.
- */
-extern void
-xen_network_free(xen_network network);
-
-
-typedef struct xen_network_set
-{
-    size_t size;
-    xen_network *contents[];
-} xen_network_set;
-
-/**
- * Allocate a xen_network_set of the given size.
- */
-extern xen_network_set *
-xen_network_set_alloc(size_t size);
-
-/**
- * Free the given xen_network_set.  The given set must have been
- * allocated by this library.
- */
-extern void
-xen_network_set_free(xen_network_set *set);
-
-
-typedef struct xen_network_record
-{
-    xen_network handle;
-    char *uuid;
-    char *name_label;
-    char *name_description;
-    struct xen_vif_record_opt_set *vifs;
-    struct xen_pif_record_opt_set *pifs;
-    xen_string_string_map *other_config;
-} xen_network_record;
-
-/**
- * Allocate a xen_network_record.
- */
-extern xen_network_record *
-xen_network_record_alloc(void);
-
-/**
- * Free the given xen_network_record, and all referenced values.  The
- * given record must have been allocated by this library.
- */
-extern void
-xen_network_record_free(xen_network_record *record);
-
-
-typedef struct xen_network_record_opt
-{
-    bool is_record;
-    union
-    {
-        xen_network handle;
-        xen_network_record *record;
-    } u;
-} xen_network_record_opt;
-
-/**
- * Allocate a xen_network_record_opt.
- */
-extern xen_network_record_opt *
-xen_network_record_opt_alloc(void);
-
-/**
- * Free the given xen_network_record_opt, and all referenced values. 
- * The given record_opt must have been allocated by this library.
- */
-extern void
-xen_network_record_opt_free(xen_network_record_opt *record_opt);
-
-
-typedef struct xen_network_record_set
-{
-    size_t size;
-    xen_network_record *contents[];
-} xen_network_record_set;
-
-/**
- * Allocate a xen_network_record_set of the given size.
- */
-extern xen_network_record_set *
-xen_network_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_network_record_set, and all referenced values. 
- * The given set must have been allocated by this library.
- */
-extern void
-xen_network_record_set_free(xen_network_record_set *set);
-
-
-
-typedef struct xen_network_record_opt_set
-{
-    size_t size;
-    xen_network_record_opt *contents[];
-} xen_network_record_opt_set;
-
-/**
- * Allocate a xen_network_record_opt_set of the given size.
- */
-extern xen_network_record_opt_set *
-xen_network_record_opt_set_alloc(size_t size);
-
-/**
- * Free the given xen_network_record_opt_set, and all referenced
- * values.  The given set must have been allocated by this library.
- */
-extern void
-xen_network_record_opt_set_free(xen_network_record_opt_set *set);
-
-
-/**
- * Get a record containing the current state of the given network.
- */
-extern bool
-xen_network_get_record(xen_session *session, xen_network_record **result, xen_network network);
-
-
-/**
- * Get a reference to the network instance with the specified UUID.
- */
-extern bool
-xen_network_get_by_uuid(xen_session *session, xen_network *result, char *uuid);
-
-
-/**
- * Create a new network instance, and return its handle.
- */
-extern bool
-xen_network_create(xen_session *session, xen_network *result, xen_network_record *record);
-
-
-/**
- * Destroy the specified network instance.
- */
-extern bool
-xen_network_destroy(xen_session *session, xen_network network);
-
-
-/**
- * Get all the network instances with the given label.
- */
-extern bool
-xen_network_get_by_name_label(xen_session *session, struct xen_network_set **result, char *label);
-
-
-/**
- * Get the uuid field of the given network.
- */
-extern bool
-xen_network_get_uuid(xen_session *session, char **result, xen_network network);
-
-
-/**
- * Get the name/label field of the given network.
- */
-extern bool
-xen_network_get_name_label(xen_session *session, char **result, xen_network network);
-
-
-/**
- * Get the name/description field of the given network.
- */
-extern bool
-xen_network_get_name_description(xen_session *session, char **result, xen_network network);
-
-
-/**
- * Get the VIFs field of the given network.
- */
-extern bool
-xen_network_get_vifs(xen_session *session, struct xen_vif_set **result, xen_network network);
-
-
-/**
- * Get the PIFs field of the given network.
- */
-extern bool
-xen_network_get_pifs(xen_session *session, struct xen_pif_set **result, xen_network network);
-
-
-/**
- * Get the other_config field of the given network.
- */
-extern bool
-xen_network_get_other_config(xen_session *session, xen_string_string_map **result, xen_network network);
-
-
-/**
- * Set the name/label field of the given network.
- */
-extern bool
-xen_network_set_name_label(xen_session *session, xen_network network, char *label);
-
-
-/**
- * Set the name/description field of the given network.
- */
-extern bool
-xen_network_set_name_description(xen_session *session, xen_network network, char *description);
-
-
-/**
- * Set the other_config field of the given network.
- */
-extern bool
-xen_network_set_other_config(xen_session *session, xen_network network, xen_string_string_map *other_config);
-
-
-/**
- * Add the given key-value pair to the other_config field of the given
- * network.
- */
-extern bool
-xen_network_add_to_other_config(xen_session *session, xen_network network, char *key, char *value);
-
-
-/**
- * Remove the given key and its corresponding value from the
- * other_config field of the given network.  If the key is not in that Map,
- * then do nothing.
- */
-extern bool
-xen_network_remove_from_other_config(xen_session *session, xen_network network, char *key);
-
-
-/**
- * Return a list of all the networks known to the system.
- */
-extern bool
-xen_network_get_all(xen_session *session, struct xen_network_set **result);
-
-
-#endif
diff --git a/tools/libxen/include/xen_network_decl.h b/tools/libxen/include/xen_network_decl.h
deleted file mode 100644 (file)
index d970c2a..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_NETWORK_DECL_H
-#define XEN_NETWORK_DECL_H
-
-typedef void *xen_network;
-
-struct xen_network_set;
-struct xen_network_record;
-struct xen_network_record_set;
-struct xen_network_record_opt;
-struct xen_network_record_opt_set;
-
-#endif
diff --git a/tools/libxen/include/xen_on_crash_behaviour.h b/tools/libxen/include/xen_on_crash_behaviour.h
deleted file mode 100644 (file)
index 8286488..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_ON_CRASH_BEHAVIOUR_H
-#define XEN_ON_CRASH_BEHAVIOUR_H
-
-
-#include "xen_common.h"
-
-
-enum xen_on_crash_behaviour
-{
-    /**
-     * destroy the VM state
-     */
-    XEN_ON_CRASH_BEHAVIOUR_DESTROY,
-
-    /**
-     * record a coredump and then destroy the VM state
-     */
-    XEN_ON_CRASH_BEHAVIOUR_COREDUMP_AND_DESTROY,
-
-    /**
-     * restart the VM
-     */
-    XEN_ON_CRASH_BEHAVIOUR_RESTART,
-
-    /**
-     * record a coredump and then restart the VM
-     */
-    XEN_ON_CRASH_BEHAVIOUR_COREDUMP_AND_RESTART,
-
-    /**
-     * leave the crashed VM as-is
-     */
-    XEN_ON_CRASH_BEHAVIOUR_PRESERVE,
-
-    /**
-     * rename the crashed VM and start a new copy
-     */
-    XEN_ON_CRASH_BEHAVIOUR_RENAME_RESTART
-};
-
-
-typedef struct xen_on_crash_behaviour_set
-{
-    size_t size;
-    enum xen_on_crash_behaviour contents[];
-} xen_on_crash_behaviour_set;
-
-/**
- * Allocate a xen_on_crash_behaviour_set of the given size.
- */
-extern xen_on_crash_behaviour_set *
-xen_on_crash_behaviour_set_alloc(size_t size);
-
-/**
- * Free the given xen_on_crash_behaviour_set.  The given set must have
- * been allocated by this library.
- */
-extern void
-xen_on_crash_behaviour_set_free(xen_on_crash_behaviour_set *set);
-
-
-/**
- * Return the name corresponding to the given code.  This string must
- * not be modified or freed.
- */
-extern const char *
-xen_on_crash_behaviour_to_string(enum xen_on_crash_behaviour val);
-
-
-/**
- * Return the correct code for the given string, or set the session
- * object to failure and return an undefined value if the given string does
- * not match a known code.
- */
-extern enum xen_on_crash_behaviour
-xen_on_crash_behaviour_from_string(xen_session *session, const char *str);
-
-
-#endif
index 012398b8144c31a6c201d31ecd8b0439fbe22cf0..bd6f1faa7aa84fdf60afd24e9ebe08b5b5885380 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, XenSource Inc.
+ * Copyright (c) 2006-2007, XenSource Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
diff --git a/tools/libxen/include/xen_on_normal_exit.h b/tools/libxen/include/xen_on_normal_exit.h
deleted file mode 100644 (file)
index 3897fef..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_ON_NORMAL_EXIT_H
-#define XEN_ON_NORMAL_EXIT_H
-
-
-#include "xen_common.h"
-
-
-enum xen_on_normal_exit
-{
-    /**
-     * destroy the VM state
-     */
-    XEN_ON_NORMAL_EXIT_DESTROY,
-
-    /**
-     * restart the VM
-     */
-    XEN_ON_NORMAL_EXIT_RESTART
-};
-
-
-typedef struct xen_on_normal_exit_set
-{
-    size_t size;
-    enum xen_on_normal_exit contents[];
-} xen_on_normal_exit_set;
-
-/**
- * Allocate a xen_on_normal_exit_set of the given size.
- */
-extern xen_on_normal_exit_set *
-xen_on_normal_exit_set_alloc(size_t size);
-
-/**
- * Free the given xen_on_normal_exit_set.  The given set must have been
- * allocated by this library.
- */
-extern void
-xen_on_normal_exit_set_free(xen_on_normal_exit_set *set);
-
-
-/**
- * Return the name corresponding to the given code.  This string must
- * not be modified or freed.
- */
-extern const char *
-xen_on_normal_exit_to_string(enum xen_on_normal_exit val);
-
-
-/**
- * Return the correct code for the given string, or set the session
- * object to failure and return an undefined value if the given string does
- * not match a known code.
- */
-extern enum xen_on_normal_exit
-xen_on_normal_exit_from_string(xen_session *session, const char *str);
-
-
-#endif
index 3a94f8919ce96e204332d2644d4abecb3c533f64..ffff46a86993e7d12f993d19ad7f0e30cb8e19c9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, XenSource Inc.
+ * Copyright (c) 2006-2007, XenSource Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
diff --git a/tools/libxen/include/xen_pbd.h b/tools/libxen/include/xen_pbd.h
deleted file mode 100644 (file)
index 335d20b..0000000
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_PBD_H
-#define XEN_PBD_H
-
-#include "xen_common.h"
-#include "xen_host_decl.h"
-#include "xen_pbd_decl.h"
-#include "xen_sr_decl.h"
-#include "xen_string_string_map.h"
-
-
-/*
- * The PBD class.
- * 
- * The physical block devices through which hosts access SRs.
- */
-
-
-/**
- * Free the given xen_pbd.  The given handle must have been allocated
- * by this library.
- */
-extern void
-xen_pbd_free(xen_pbd pbd);
-
-
-typedef struct xen_pbd_set
-{
-    size_t size;
-    xen_pbd *contents[];
-} xen_pbd_set;
-
-/**
- * Allocate a xen_pbd_set of the given size.
- */
-extern xen_pbd_set *
-xen_pbd_set_alloc(size_t size);
-
-/**
- * Free the given xen_pbd_set.  The given set must have been allocated
- * by this library.
- */
-extern void
-xen_pbd_set_free(xen_pbd_set *set);
-
-
-typedef struct xen_pbd_record
-{
-    xen_pbd handle;
-    char *uuid;
-    struct xen_host_record_opt *host;
-    struct xen_sr_record_opt *sr;
-    xen_string_string_map *device_config;
-    bool currently_attached;
-} xen_pbd_record;
-
-/**
- * Allocate a xen_pbd_record.
- */
-extern xen_pbd_record *
-xen_pbd_record_alloc(void);
-
-/**
- * Free the given xen_pbd_record, and all referenced values.  The given
- * record must have been allocated by this library.
- */
-extern void
-xen_pbd_record_free(xen_pbd_record *record);
-
-
-typedef struct xen_pbd_record_opt
-{
-    bool is_record;
-    union
-    {
-        xen_pbd handle;
-        xen_pbd_record *record;
-    } u;
-} xen_pbd_record_opt;
-
-/**
- * Allocate a xen_pbd_record_opt.
- */
-extern xen_pbd_record_opt *
-xen_pbd_record_opt_alloc(void);
-
-/**
- * Free the given xen_pbd_record_opt, and all referenced values.  The
- * given record_opt must have been allocated by this library.
- */
-extern void
-xen_pbd_record_opt_free(xen_pbd_record_opt *record_opt);
-
-
-typedef struct xen_pbd_record_set
-{
-    size_t size;
-    xen_pbd_record *contents[];
-} xen_pbd_record_set;
-
-/**
- * Allocate a xen_pbd_record_set of the given size.
- */
-extern xen_pbd_record_set *
-xen_pbd_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_pbd_record_set, and all referenced values.  The
- * given set must have been allocated by this library.
- */
-extern void
-xen_pbd_record_set_free(xen_pbd_record_set *set);
-
-
-
-typedef struct xen_pbd_record_opt_set
-{
-    size_t size;
-    xen_pbd_record_opt *contents[];
-} xen_pbd_record_opt_set;
-
-/**
- * Allocate a xen_pbd_record_opt_set of the given size.
- */
-extern xen_pbd_record_opt_set *
-xen_pbd_record_opt_set_alloc(size_t size);
-
-/**
- * Free the given xen_pbd_record_opt_set, and all referenced values. 
- * The given set must have been allocated by this library.
- */
-extern void
-xen_pbd_record_opt_set_free(xen_pbd_record_opt_set *set);
-
-
-/**
- * Get a record containing the current state of the given PBD.
- */
-extern bool
-xen_pbd_get_record(xen_session *session, xen_pbd_record **result, xen_pbd pbd);
-
-
-/**
- * Get a reference to the PBD instance with the specified UUID.
- */
-extern bool
-xen_pbd_get_by_uuid(xen_session *session, xen_pbd *result, char *uuid);
-
-
-/**
- * Create a new PBD instance, and return its handle.
- */
-extern bool
-xen_pbd_create(xen_session *session, xen_pbd *result, xen_pbd_record *record);
-
-
-/**
- * Destroy the specified PBD instance.
- */
-extern bool
-xen_pbd_destroy(xen_session *session, xen_pbd pbd);
-
-
-/**
- * Get the uuid field of the given PBD.
- */
-extern bool
-xen_pbd_get_uuid(xen_session *session, char **result, xen_pbd pbd);
-
-
-/**
- * Get the host field of the given PBD.
- */
-extern bool
-xen_pbd_get_host(xen_session *session, xen_host *result, xen_pbd pbd);
-
-
-/**
- * Get the SR field of the given PBD.
- */
-extern bool
-xen_pbd_get_sr(xen_session *session, xen_sr *result, xen_pbd pbd);
-
-
-/**
- * Get the device_config field of the given PBD.
- */
-extern bool
-xen_pbd_get_device_config(xen_session *session, xen_string_string_map **result, xen_pbd pbd);
-
-
-/**
- * Get the currently_attached field of the given PBD.
- */
-extern bool
-xen_pbd_get_currently_attached(xen_session *session, bool *result, xen_pbd pbd);
-
-
-/**
- * Return a list of all the PBDs known to the system.
- */
-extern bool
-xen_pbd_get_all(xen_session *session, struct xen_pbd_set **result);
-
-
-#endif
diff --git a/tools/libxen/include/xen_pbd_decl.h b/tools/libxen/include/xen_pbd_decl.h
deleted file mode 100644 (file)
index 81f8f4b..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_PBD_DECL_H
-#define XEN_PBD_DECL_H
-
-typedef void *xen_pbd;
-
-struct xen_pbd_set;
-struct xen_pbd_record;
-struct xen_pbd_record_set;
-struct xen_pbd_record_opt;
-struct xen_pbd_record_opt_set;
-
-#endif
diff --git a/tools/libxen/include/xen_pif.h b/tools/libxen/include/xen_pif.h
deleted file mode 100644 (file)
index 63fc884..0000000
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_PIF_H
-#define XEN_PIF_H
-
-#include "xen_common.h"
-#include "xen_host_decl.h"
-#include "xen_network_decl.h"
-#include "xen_pif_decl.h"
-#include "xen_pif_metrics_decl.h"
-
-
-/*
- * The PIF class.
- * 
- * A physical network interface (note separate VLANs are represented as
- * several PIFs).
- */
-
-
-/**
- * Free the given xen_pif.  The given handle must have been allocated
- * by this library.
- */
-extern void
-xen_pif_free(xen_pif pif);
-
-
-typedef struct xen_pif_set
-{
-    size_t size;
-    xen_pif *contents[];
-} xen_pif_set;
-
-/**
- * Allocate a xen_pif_set of the given size.
- */
-extern xen_pif_set *
-xen_pif_set_alloc(size_t size);
-
-/**
- * Free the given xen_pif_set.  The given set must have been allocated
- * by this library.
- */
-extern void
-xen_pif_set_free(xen_pif_set *set);
-
-
-typedef struct xen_pif_record
-{
-    xen_pif handle;
-    char *uuid;
-    char *device;
-    struct xen_network_record_opt *network;
-    struct xen_host_record_opt *host;
-    char *mac;
-    int64_t mtu;
-    int64_t vlan;
-    struct xen_pif_metrics_record_opt *metrics;
-} xen_pif_record;
-
-/**
- * Allocate a xen_pif_record.
- */
-extern xen_pif_record *
-xen_pif_record_alloc(void);
-
-/**
- * Free the given xen_pif_record, and all referenced values.  The given
- * record must have been allocated by this library.
- */
-extern void
-xen_pif_record_free(xen_pif_record *record);
-
-
-typedef struct xen_pif_record_opt
-{
-    bool is_record;
-    union
-    {
-        xen_pif handle;
-        xen_pif_record *record;
-    } u;
-} xen_pif_record_opt;
-
-/**
- * Allocate a xen_pif_record_opt.
- */
-extern xen_pif_record_opt *
-xen_pif_record_opt_alloc(void);
-
-/**
- * Free the given xen_pif_record_opt, and all referenced values.  The
- * given record_opt must have been allocated by this library.
- */
-extern void
-xen_pif_record_opt_free(xen_pif_record_opt *record_opt);
-
-
-typedef struct xen_pif_record_set
-{
-    size_t size;
-    xen_pif_record *contents[];
-} xen_pif_record_set;
-
-/**
- * Allocate a xen_pif_record_set of the given size.
- */
-extern xen_pif_record_set *
-xen_pif_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_pif_record_set, and all referenced values.  The
- * given set must have been allocated by this library.
- */
-extern void
-xen_pif_record_set_free(xen_pif_record_set *set);
-
-
-
-typedef struct xen_pif_record_opt_set
-{
-    size_t size;
-    xen_pif_record_opt *contents[];
-} xen_pif_record_opt_set;
-
-/**
- * Allocate a xen_pif_record_opt_set of the given size.
- */
-extern xen_pif_record_opt_set *
-xen_pif_record_opt_set_alloc(size_t size);
-
-/**
- * Free the given xen_pif_record_opt_set, and all referenced values. 
- * The given set must have been allocated by this library.
- */
-extern void
-xen_pif_record_opt_set_free(xen_pif_record_opt_set *set);
-
-
-/**
- * Get a record containing the current state of the given PIF.
- */
-extern bool
-xen_pif_get_record(xen_session *session, xen_pif_record **result, xen_pif pif);
-
-
-/**
- * Get a reference to the PIF instance with the specified UUID.
- */
-extern bool
-xen_pif_get_by_uuid(xen_session *session, xen_pif *result, char *uuid);
-
-
-/**
- * Get the uuid field of the given PIF.
- */
-extern bool
-xen_pif_get_uuid(xen_session *session, char **result, xen_pif pif);
-
-
-/**
- * Get the device field of the given PIF.
- */
-extern bool
-xen_pif_get_device(xen_session *session, char **result, xen_pif pif);
-
-
-/**
- * Get the network field of the given PIF.
- */
-extern bool
-xen_pif_get_network(xen_session *session, xen_network *result, xen_pif pif);
-
-
-/**
- * Get the host field of the given PIF.
- */
-extern bool
-xen_pif_get_host(xen_session *session, xen_host *result, xen_pif pif);
-
-
-/**
- * Get the MAC field of the given PIF.
- */
-extern bool
-xen_pif_get_mac(xen_session *session, char **result, xen_pif pif);
-
-
-/**
- * Get the MTU field of the given PIF.
- */
-extern bool
-xen_pif_get_mtu(xen_session *session, int64_t *result, xen_pif pif);
-
-
-/**
- * Get the VLAN field of the given PIF.
- */
-extern bool
-xen_pif_get_vlan(xen_session *session, int64_t *result, xen_pif pif);
-
-
-/**
- * Get the metrics field of the given PIF.
- */
-extern bool
-xen_pif_get_metrics(xen_session *session, xen_pif_metrics *result, xen_pif pif);
-
-
-/**
- * Set the device field of the given PIF.
- */
-extern bool
-xen_pif_set_device(xen_session *session, xen_pif pif, char *device);
-
-
-/**
- * Set the MAC field of the given PIF.
- */
-extern bool
-xen_pif_set_mac(xen_session *session, xen_pif pif, char *mac);
-
-
-/**
- * Set the MTU field of the given PIF.
- */
-extern bool
-xen_pif_set_mtu(xen_session *session, xen_pif pif, int64_t mtu);
-
-
-/**
- * Set the VLAN field of the given PIF.
- */
-extern bool
-xen_pif_set_vlan(xen_session *session, xen_pif pif, int64_t vlan);
-
-
-/**
- * Create a VLAN interface from an existing physical interface
- */
-extern bool
-xen_pif_create_vlan(xen_session *session, xen_pif *result, char *device, xen_network network, xen_host host, int64_t vlan);
-
-
-/**
- * Destroy the interface (provided it is a synthetic interface like a
- * VLAN; fail if it is a physical interface)
- */
-extern bool
-xen_pif_destroy(xen_session *session, xen_pif self);
-
-
-/**
- * Return a list of all the PIFs known to the system.
- */
-extern bool
-xen_pif_get_all(xen_session *session, struct xen_pif_set **result);
-
-
-#endif
diff --git a/tools/libxen/include/xen_pif_decl.h b/tools/libxen/include/xen_pif_decl.h
deleted file mode 100644 (file)
index b326bea..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_PIF_DECL_H
-#define XEN_PIF_DECL_H
-
-typedef void *xen_pif;
-
-struct xen_pif_set;
-struct xen_pif_record;
-struct xen_pif_record_set;
-struct xen_pif_record_opt;
-struct xen_pif_record_opt_set;
-
-#endif
diff --git a/tools/libxen/include/xen_pif_metrics.h b/tools/libxen/include/xen_pif_metrics.h
deleted file mode 100644 (file)
index 970700f..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_PIF_METRICS_H
-#define XEN_PIF_METRICS_H
-
-#include "xen_common.h"
-#include "xen_pif_metrics_decl.h"
-
-
-/*
- * The PIF_metrics class.
- * 
- * The metrics associated with a physical network interface.
- */
-
-
-/**
- * Free the given xen_pif_metrics.  The given handle must have been
- * allocated by this library.
- */
-extern void
-xen_pif_metrics_free(xen_pif_metrics pif_metrics);
-
-
-typedef struct xen_pif_metrics_set
-{
-    size_t size;
-    xen_pif_metrics *contents[];
-} xen_pif_metrics_set;
-
-/**
- * Allocate a xen_pif_metrics_set of the given size.
- */
-extern xen_pif_metrics_set *
-xen_pif_metrics_set_alloc(size_t size);
-
-/**
- * Free the given xen_pif_metrics_set.  The given set must have been
- * allocated by this library.
- */
-extern void
-xen_pif_metrics_set_free(xen_pif_metrics_set *set);
-
-
-typedef struct xen_pif_metrics_record
-{
-    xen_pif_metrics handle;
-    char *uuid;
-    double io_read_kbs;
-    double io_write_kbs;
-    time_t last_updated;
-} xen_pif_metrics_record;
-
-/**
- * Allocate a xen_pif_metrics_record.
- */
-extern xen_pif_metrics_record *
-xen_pif_metrics_record_alloc(void);
-
-/**
- * Free the given xen_pif_metrics_record, and all referenced values. 
- * The given record must have been allocated by this library.
- */
-extern void
-xen_pif_metrics_record_free(xen_pif_metrics_record *record);
-
-
-typedef struct xen_pif_metrics_record_opt
-{
-    bool is_record;
-    union
-    {
-        xen_pif_metrics handle;
-        xen_pif_metrics_record *record;
-    } u;
-} xen_pif_metrics_record_opt;
-
-/**
- * Allocate a xen_pif_metrics_record_opt.
- */
-extern xen_pif_metrics_record_opt *
-xen_pif_metrics_record_opt_alloc(void);
-
-/**
- * Free the given xen_pif_metrics_record_opt, and all referenced
- * values.  The given record_opt must have been allocated by this library.
- */
-extern void
-xen_pif_metrics_record_opt_free(xen_pif_metrics_record_opt *record_opt);
-
-
-typedef struct xen_pif_metrics_record_set
-{
-    size_t size;
-    xen_pif_metrics_record *contents[];
-} xen_pif_metrics_record_set;
-
-/**
- * Allocate a xen_pif_metrics_record_set of the given size.
- */
-extern xen_pif_metrics_record_set *
-xen_pif_metrics_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_pif_metrics_record_set, and all referenced
- * values.  The given set must have been allocated by this library.
- */
-extern void
-xen_pif_metrics_record_set_free(xen_pif_metrics_record_set *set);
-
-
-
-typedef struct xen_pif_metrics_record_opt_set
-{
-    size_t size;
-    xen_pif_metrics_record_opt *contents[];
-} xen_pif_metrics_record_opt_set;
-
-/**
- * Allocate a xen_pif_metrics_record_opt_set of the given size.
- */
-extern xen_pif_metrics_record_opt_set *
-xen_pif_metrics_record_opt_set_alloc(size_t size);
-
-/**
- * Free the given xen_pif_metrics_record_opt_set, and all referenced
- * values.  The given set must have been allocated by this library.
- */
-extern void
-xen_pif_metrics_record_opt_set_free(xen_pif_metrics_record_opt_set *set);
-
-
-/**
- * Get a record containing the current state of the given PIF_metrics.
- */
-extern bool
-xen_pif_metrics_get_record(xen_session *session, xen_pif_metrics_record **result, xen_pif_metrics pif_metrics);
-
-
-/**
- * Get a reference to the PIF_metrics instance with the specified UUID.
- */
-extern bool
-xen_pif_metrics_get_by_uuid(xen_session *session, xen_pif_metrics *result, char *uuid);
-
-
-/**
- * Get the uuid field of the given PIF_metrics.
- */
-extern bool
-xen_pif_metrics_get_uuid(xen_session *session, char **result, xen_pif_metrics pif_metrics);
-
-
-/**
- * Get the io/read_kbs field of the given PIF_metrics.
- */
-extern bool
-xen_pif_metrics_get_io_read_kbs(xen_session *session, double *result, xen_pif_metrics pif_metrics);
-
-
-/**
- * Get the io/write_kbs field of the given PIF_metrics.
- */
-extern bool
-xen_pif_metrics_get_io_write_kbs(xen_session *session, double *result, xen_pif_metrics pif_metrics);
-
-
-/**
- * Get the last_updated field of the given PIF_metrics.
- */
-extern bool
-xen_pif_metrics_get_last_updated(xen_session *session, time_t *result, xen_pif_metrics pif_metrics);
-
-
-/**
- * Return a list of all the PIF_metrics instances known to the system.
- */
-extern bool
-xen_pif_metrics_get_all(xen_session *session, struct xen_pif_metrics_set **result);
-
-
-#endif
diff --git a/tools/libxen/include/xen_pif_metrics_decl.h b/tools/libxen/include/xen_pif_metrics_decl.h
deleted file mode 100644 (file)
index 71afe69..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_PIF_METRICS_DECL_H
-#define XEN_PIF_METRICS_DECL_H
-
-typedef void *xen_pif_metrics;
-
-struct xen_pif_metrics_set;
-struct xen_pif_metrics_record;
-struct xen_pif_metrics_record_set;
-struct xen_pif_metrics_record_opt;
-struct xen_pif_metrics_record_opt_set;
-
-#endif
diff --git a/tools/libxen/include/xen_sr.h b/tools/libxen/include/xen_sr.h
deleted file mode 100644 (file)
index 39a8dd6..0000000
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_SR_H
-#define XEN_SR_H
-
-#include "xen_common.h"
-#include "xen_pbd_decl.h"
-#include "xen_sr_decl.h"
-#include "xen_string_set.h"
-#include "xen_vdi_decl.h"
-
-
-/*
- * The SR class.
- * 
- * A storage repository.
- */
-
-
-/**
- * Free the given xen_sr.  The given handle must have been allocated by
- * this library.
- */
-extern void
-xen_sr_free(xen_sr sr);
-
-
-typedef struct xen_sr_set
-{
-    size_t size;
-    xen_sr *contents[];
-} xen_sr_set;
-
-/**
- * Allocate a xen_sr_set of the given size.
- */
-extern xen_sr_set *
-xen_sr_set_alloc(size_t size);
-
-/**
- * Free the given xen_sr_set.  The given set must have been allocated
- * by this library.
- */
-extern void
-xen_sr_set_free(xen_sr_set *set);
-
-
-typedef struct xen_sr_record
-{
-    xen_sr handle;
-    char *uuid;
-    char *name_label;
-    char *name_description;
-    struct xen_vdi_record_opt_set *vdis;
-    struct xen_pbd_record_opt_set *pbds;
-    int64_t virtual_allocation;
-    int64_t physical_utilisation;
-    int64_t physical_size;
-    char *type;
-    char *content_type;
-} xen_sr_record;
-
-/**
- * Allocate a xen_sr_record.
- */
-extern xen_sr_record *
-xen_sr_record_alloc(void);
-
-/**
- * Free the given xen_sr_record, and all referenced values.  The given
- * record must have been allocated by this library.
- */
-extern void
-xen_sr_record_free(xen_sr_record *record);
-
-
-typedef struct xen_sr_record_opt
-{
-    bool is_record;
-    union
-    {
-        xen_sr handle;
-        xen_sr_record *record;
-    } u;
-} xen_sr_record_opt;
-
-/**
- * Allocate a xen_sr_record_opt.
- */
-extern xen_sr_record_opt *
-xen_sr_record_opt_alloc(void);
-
-/**
- * Free the given xen_sr_record_opt, and all referenced values.  The
- * given record_opt must have been allocated by this library.
- */
-extern void
-xen_sr_record_opt_free(xen_sr_record_opt *record_opt);
-
-
-typedef struct xen_sr_record_set
-{
-    size_t size;
-    xen_sr_record *contents[];
-} xen_sr_record_set;
-
-/**
- * Allocate a xen_sr_record_set of the given size.
- */
-extern xen_sr_record_set *
-xen_sr_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_sr_record_set, and all referenced values.  The
- * given set must have been allocated by this library.
- */
-extern void
-xen_sr_record_set_free(xen_sr_record_set *set);
-
-
-
-typedef struct xen_sr_record_opt_set
-{
-    size_t size;
-    xen_sr_record_opt *contents[];
-} xen_sr_record_opt_set;
-
-/**
- * Allocate a xen_sr_record_opt_set of the given size.
- */
-extern xen_sr_record_opt_set *
-xen_sr_record_opt_set_alloc(size_t size);
-
-/**
- * Free the given xen_sr_record_opt_set, and all referenced values. 
- * The given set must have been allocated by this library.
- */
-extern void
-xen_sr_record_opt_set_free(xen_sr_record_opt_set *set);
-
-
-/**
- * Get a record containing the current state of the given SR.
- */
-extern bool
-xen_sr_get_record(xen_session *session, xen_sr_record **result, xen_sr sr);
-
-
-/**
- * Get a reference to the SR instance with the specified UUID.
- */
-extern bool
-xen_sr_get_by_uuid(xen_session *session, xen_sr *result, char *uuid);
-
-
-/**
- * Get all the SR instances with the given label.
- */
-extern bool
-xen_sr_get_by_name_label(xen_session *session, struct xen_sr_set **result, char *label);
-
-
-/**
- * Get the uuid field of the given SR.
- */
-extern bool
-xen_sr_get_uuid(xen_session *session, char **result, xen_sr sr);
-
-
-/**
- * Get the name/label field of the given SR.
- */
-extern bool
-xen_sr_get_name_label(xen_session *session, char **result, xen_sr sr);
-
-
-/**
- * Get the name/description field of the given SR.
- */
-extern bool
-xen_sr_get_name_description(xen_session *session, char **result, xen_sr sr);
-
-
-/**
- * Get the VDIs field of the given SR.
- */
-extern bool
-xen_sr_get_vdis(xen_session *session, struct xen_vdi_set **result, xen_sr sr);
-
-
-/**
- * Get the PBDs field of the given SR.
- */
-extern bool
-xen_sr_get_pbds(xen_session *session, struct xen_pbd_set **result, xen_sr sr);
-
-
-/**
- * Get the virtual_allocation field of the given SR.
- */
-extern bool
-xen_sr_get_virtual_allocation(xen_session *session, int64_t *result, xen_sr sr);
-
-
-/**
- * Get the physical_utilisation field of the given SR.
- */
-extern bool
-xen_sr_get_physical_utilisation(xen_session *session, int64_t *result, xen_sr sr);
-
-
-/**
- * Get the physical_size field of the given SR.
- */
-extern bool
-xen_sr_get_physical_size(xen_session *session, int64_t *result, xen_sr sr);
-
-
-/**
- * Get the type field of the given SR.
- */
-extern bool
-xen_sr_get_type(xen_session *session, char **result, xen_sr sr);
-
-
-/**
- * Get the content_type field of the given SR.
- */
-extern bool
-xen_sr_get_content_type(xen_session *session, char **result, xen_sr sr);
-
-
-/**
- * Set the name/label field of the given SR.
- */
-extern bool
-xen_sr_set_name_label(xen_session *session, xen_sr sr, char *label);
-
-
-/**
- * Set the name/description field of the given SR.
- */
-extern bool
-xen_sr_set_name_description(xen_session *session, xen_sr sr, char *description);
-
-
-/**
- * Return a set of all the SR types supported by the system.
- */
-extern bool
-xen_sr_get_supported_types(xen_session *session, struct xen_string_set **result);
-
-
-/**
- * Return a list of all the SRs known to the system.
- */
-extern bool
-xen_sr_get_all(xen_session *session, struct xen_sr_set **result);
-
-
-#endif
diff --git a/tools/libxen/include/xen_sr_decl.h b/tools/libxen/include/xen_sr_decl.h
deleted file mode 100644 (file)
index 533e90c..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_SR_DECL_H
-#define XEN_SR_DECL_H
-
-typedef void *xen_sr;
-
-struct xen_sr_set;
-struct xen_sr_record;
-struct xen_sr_record_set;
-struct xen_sr_record_opt;
-struct xen_sr_record_opt_set;
-
-#endif
diff --git a/tools/libxen/include/xen_string_set.h b/tools/libxen/include/xen_string_set.h
deleted file mode 100644 (file)
index a14af94..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_STRING_SET_H
-#define XEN_STRING_SET_H
-
-
-#include "xen_common.h"
-
-
-typedef struct xen_string_set
-{
-    size_t size;
-    char *contents[];
-} xen_string_set;
-
-
-/**
- * Allocate a xen_string_set of the given size.
- */
-extern xen_string_set *
-xen_string_set_alloc(size_t size);
-
-/**
- * Free the given xen_string_set.  The given set must have been allocated
- * by this library.
- */
-extern void
-xen_string_set_free(xen_string_set *set);
-
-
-#endif
diff --git a/tools/libxen/include/xen_string_string_map.h b/tools/libxen/include/xen_string_string_map.h
deleted file mode 100644 (file)
index e3e5f68..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_STRING_STRING_MAP_H
-#define XEN_STRING_STRING_MAP_H
-
-
-#include "xen_common.h"
-
-
-typedef struct xen_string_string_map_contents
-{
-  char *key;
-  char *val;
-} xen_string_string_map_contents;
-
-
-typedef struct xen_string_string_map
-{
-    size_t size;
-    xen_string_string_map_contents contents[];
-} xen_string_string_map;
-
-/**
- * Allocate a xen_string_string_map of the given size.
- */
-extern xen_string_string_map *
-xen_string_string_map_alloc(size_t size);
-
-/**
- * Free the given xen_string_string_map, and all referenced values. 
- * The given map must have been allocated by this library.
- */
-extern void
-xen_string_string_map_free(xen_string_string_map *map);
-
-
-#endif
diff --git a/tools/libxen/include/xen_user.h b/tools/libxen/include/xen_user.h
deleted file mode 100644 (file)
index 9669e07..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_USER_H
-#define XEN_USER_H
-
-#include "xen_common.h"
-#include "xen_user_decl.h"
-
-
-/*
- * The user class.
- * 
- * A user of the system.
- */
-
-
-/**
- * Free the given xen_user.  The given handle must have been allocated
- * by this library.
- */
-extern void
-xen_user_free(xen_user user);
-
-
-typedef struct xen_user_set
-{
-    size_t size;
-    xen_user *contents[];
-} xen_user_set;
-
-/**
- * Allocate a xen_user_set of the given size.
- */
-extern xen_user_set *
-xen_user_set_alloc(size_t size);
-
-/**
- * Free the given xen_user_set.  The given set must have been allocated
- * by this library.
- */
-extern void
-xen_user_set_free(xen_user_set *set);
-
-
-typedef struct xen_user_record
-{
-    xen_user handle;
-    char *uuid;
-    char *short_name;
-    char *fullname;
-} xen_user_record;
-
-/**
- * Allocate a xen_user_record.
- */
-extern xen_user_record *
-xen_user_record_alloc(void);
-
-/**
- * Free the given xen_user_record, and all referenced values.  The
- * given record must have been allocated by this library.
- */
-extern void
-xen_user_record_free(xen_user_record *record);
-
-
-typedef struct xen_user_record_opt
-{
-    bool is_record;
-    union
-    {
-        xen_user handle;
-        xen_user_record *record;
-    } u;
-} xen_user_record_opt;
-
-/**
- * Allocate a xen_user_record_opt.
- */
-extern xen_user_record_opt *
-xen_user_record_opt_alloc(void);
-
-/**
- * Free the given xen_user_record_opt, and all referenced values.  The
- * given record_opt must have been allocated by this library.
- */
-extern void
-xen_user_record_opt_free(xen_user_record_opt *record_opt);
-
-
-typedef struct xen_user_record_set
-{
-    size_t size;
-    xen_user_record *contents[];
-} xen_user_record_set;
-
-/**
- * Allocate a xen_user_record_set of the given size.
- */
-extern xen_user_record_set *
-xen_user_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_user_record_set, and all referenced values.  The
- * given set must have been allocated by this library.
- */
-extern void
-xen_user_record_set_free(xen_user_record_set *set);
-
-
-
-typedef struct xen_user_record_opt_set
-{
-    size_t size;
-    xen_user_record_opt *contents[];
-} xen_user_record_opt_set;
-
-/**
- * Allocate a xen_user_record_opt_set of the given size.
- */
-extern xen_user_record_opt_set *
-xen_user_record_opt_set_alloc(size_t size);
-
-/**
- * Free the given xen_user_record_opt_set, and all referenced values. 
- * The given set must have been allocated by this library.
- */
-extern void
-xen_user_record_opt_set_free(xen_user_record_opt_set *set);
-
-
-/**
- * Get a record containing the current state of the given user.
- */
-extern bool
-xen_user_get_record(xen_session *session, xen_user_record **result, xen_user user);
-
-
-/**
- * Get a reference to the user instance with the specified UUID.
- */
-extern bool
-xen_user_get_by_uuid(xen_session *session, xen_user *result, char *uuid);
-
-
-/**
- * Create a new user instance, and return its handle.
- */
-extern bool
-xen_user_create(xen_session *session, xen_user *result, xen_user_record *record);
-
-
-/**
- * Destroy the specified user instance.
- */
-extern bool
-xen_user_destroy(xen_session *session, xen_user user);
-
-
-/**
- * Get the uuid field of the given user.
- */
-extern bool
-xen_user_get_uuid(xen_session *session, char **result, xen_user user);
-
-
-/**
- * Get the short_name field of the given user.
- */
-extern bool
-xen_user_get_short_name(xen_session *session, char **result, xen_user user);
-
-
-/**
- * Get the fullname field of the given user.
- */
-extern bool
-xen_user_get_fullname(xen_session *session, char **result, xen_user user);
-
-
-/**
- * Set the fullname field of the given user.
- */
-extern bool
-xen_user_set_fullname(xen_session *session, xen_user user, char *fullname);
-
-
-#endif
diff --git a/tools/libxen/include/xen_user_decl.h b/tools/libxen/include/xen_user_decl.h
deleted file mode 100644 (file)
index e5caae4..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_USER_DECL_H
-#define XEN_USER_DECL_H
-
-typedef void *xen_user;
-
-struct xen_user_set;
-struct xen_user_record;
-struct xen_user_record_set;
-struct xen_user_record_opt;
-struct xen_user_record_opt_set;
-
-#endif
diff --git a/tools/libxen/include/xen_vbd.h b/tools/libxen/include/xen_vbd.h
deleted file mode 100644 (file)
index d40af36..0000000
+++ /dev/null
@@ -1,390 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_VBD_H
-#define XEN_VBD_H
-
-#include "xen_common.h"
-#include "xen_string_set.h"
-#include "xen_string_string_map.h"
-#include "xen_vbd_decl.h"
-#include "xen_vbd_metrics_decl.h"
-#include "xen_vbd_mode.h"
-#include "xen_vbd_type.h"
-#include "xen_vdi_decl.h"
-#include "xen_vm_decl.h"
-
-
-/*
- * The VBD class.
- * 
- * A virtual block device.
- */
-
-
-/**
- * Free the given xen_vbd.  The given handle must have been allocated
- * by this library.
- */
-extern void
-xen_vbd_free(xen_vbd vbd);
-
-
-typedef struct xen_vbd_set
-{
-    size_t size;
-    xen_vbd *contents[];
-} xen_vbd_set;
-
-/**
- * Allocate a xen_vbd_set of the given size.
- */
-extern xen_vbd_set *
-xen_vbd_set_alloc(size_t size);
-
-/**
- * Free the given xen_vbd_set.  The given set must have been allocated
- * by this library.
- */
-extern void
-xen_vbd_set_free(xen_vbd_set *set);
-
-
-typedef struct xen_vbd_record
-{
-    xen_vbd handle;
-    char *uuid;
-    struct xen_vm_record_opt *vm;
-    struct xen_vdi_record_opt *vdi;
-    char *device;
-    bool bootable;
-    enum xen_vbd_mode mode;
-    enum xen_vbd_type type;
-    bool currently_attached;
-    int64_t status_code;
-    char *status_detail;
-    xen_string_string_map *runtime_properties;
-    char *qos_algorithm_type;
-    xen_string_string_map *qos_algorithm_params;
-    struct xen_string_set *qos_supported_algorithms;
-    struct xen_vbd_metrics_record_opt *metrics;
-} xen_vbd_record;
-
-/**
- * Allocate a xen_vbd_record.
- */
-extern xen_vbd_record *
-xen_vbd_record_alloc(void);
-
-/**
- * Free the given xen_vbd_record, and all referenced values.  The given
- * record must have been allocated by this library.
- */
-extern void
-xen_vbd_record_free(xen_vbd_record *record);
-
-
-typedef struct xen_vbd_record_opt
-{
-    bool is_record;
-    union
-    {
-        xen_vbd handle;
-        xen_vbd_record *record;
-    } u;
-} xen_vbd_record_opt;
-
-/**
- * Allocate a xen_vbd_record_opt.
- */
-extern xen_vbd_record_opt *
-xen_vbd_record_opt_alloc(void);
-
-/**
- * Free the given xen_vbd_record_opt, and all referenced values.  The
- * given record_opt must have been allocated by this library.
- */
-extern void
-xen_vbd_record_opt_free(xen_vbd_record_opt *record_opt);
-
-
-typedef struct xen_vbd_record_set
-{
-    size_t size;
-    xen_vbd_record *contents[];
-} xen_vbd_record_set;
-
-/**
- * Allocate a xen_vbd_record_set of the given size.
- */
-extern xen_vbd_record_set *
-xen_vbd_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_vbd_record_set, and all referenced values.  The
- * given set must have been allocated by this library.
- */
-extern void
-xen_vbd_record_set_free(xen_vbd_record_set *set);
-
-
-
-typedef struct xen_vbd_record_opt_set
-{
-    size_t size;
-    xen_vbd_record_opt *contents[];
-} xen_vbd_record_opt_set;
-
-/**
- * Allocate a xen_vbd_record_opt_set of the given size.
- */
-extern xen_vbd_record_opt_set *
-xen_vbd_record_opt_set_alloc(size_t size);
-
-/**
- * Free the given xen_vbd_record_opt_set, and all referenced values. 
- * The given set must have been allocated by this library.
- */
-extern void
-xen_vbd_record_opt_set_free(xen_vbd_record_opt_set *set);
-
-
-/**
- * Get a record containing the current state of the given VBD.
- */
-extern bool
-xen_vbd_get_record(xen_session *session, xen_vbd_record **result, xen_vbd vbd);
-
-
-/**
- * Get a reference to the VBD instance with the specified UUID.
- */
-extern bool
-xen_vbd_get_by_uuid(xen_session *session, xen_vbd *result, char *uuid);
-
-
-/**
- * Create a new VBD instance, and return its handle.
- */
-extern bool
-xen_vbd_create(xen_session *session, xen_vbd *result, xen_vbd_record *record);
-
-
-/**
- * Destroy the specified VBD instance.
- */
-extern bool
-xen_vbd_destroy(xen_session *session, xen_vbd vbd);
-
-
-/**
- * Get the uuid field of the given VBD.
- */
-extern bool
-xen_vbd_get_uuid(xen_session *session, char **result, xen_vbd vbd);
-
-
-/**
- * Get the VM field of the given VBD.
- */
-extern bool
-xen_vbd_get_vm(xen_session *session, xen_vm *result, xen_vbd vbd);
-
-
-/**
- * Get the VDI field of the given VBD.
- */
-extern bool
-xen_vbd_get_vdi(xen_session *session, xen_vdi *result, xen_vbd vbd);
-
-
-/**
- * Get the device field of the given VBD.
- */
-extern bool
-xen_vbd_get_device(xen_session *session, char **result, xen_vbd vbd);
-
-
-/**
- * Get the bootable field of the given VBD.
- */
-extern bool
-xen_vbd_get_bootable(xen_session *session, bool *result, xen_vbd vbd);
-
-
-/**
- * Get the mode field of the given VBD.
- */
-extern bool
-xen_vbd_get_mode(xen_session *session, enum xen_vbd_mode *result, xen_vbd vbd);
-
-
-/**
- * Get the type field of the given VBD.
- */
-extern bool
-xen_vbd_get_type(xen_session *session, enum xen_vbd_type *result, xen_vbd vbd);
-
-
-/**
- * Get the currently_attached field of the given VBD.
- */
-extern bool
-xen_vbd_get_currently_attached(xen_session *session, bool *result, xen_vbd vbd);
-
-
-/**
- * Get the status_code field of the given VBD.
- */
-extern bool
-xen_vbd_get_status_code(xen_session *session, int64_t *result, xen_vbd vbd);
-
-
-/**
- * Get the status_detail field of the given VBD.
- */
-extern bool
-xen_vbd_get_status_detail(xen_session *session, char **result, xen_vbd vbd);
-
-
-/**
- * Get the runtime_properties field of the given VBD.
- */
-extern bool
-xen_vbd_get_runtime_properties(xen_session *session, xen_string_string_map **result, xen_vbd vbd);
-
-
-/**
- * Get the qos/algorithm_type field of the given VBD.
- */
-extern bool
-xen_vbd_get_qos_algorithm_type(xen_session *session, char **result, xen_vbd vbd);
-
-
-/**
- * Get the qos/algorithm_params field of the given VBD.
- */
-extern bool
-xen_vbd_get_qos_algorithm_params(xen_session *session, xen_string_string_map **result, xen_vbd vbd);
-
-
-/**
- * Get the qos/supported_algorithms field of the given VBD.
- */
-extern bool
-xen_vbd_get_qos_supported_algorithms(xen_session *session, struct xen_string_set **result, xen_vbd vbd);
-
-
-/**
- * Get the metrics field of the given VBD.
- */
-extern bool
-xen_vbd_get_metrics(xen_session *session, xen_vbd_metrics *result, xen_vbd vbd);
-
-
-/**
- * Set the device field of the given VBD.
- */
-extern bool
-xen_vbd_set_device(xen_session *session, xen_vbd vbd, char *device);
-
-
-/**
- * Set the bootable field of the given VBD.
- */
-extern bool
-xen_vbd_set_bootable(xen_session *session, xen_vbd vbd, bool bootable);
-
-
-/**
- * Set the mode field of the given VBD.
- */
-extern bool
-xen_vbd_set_mode(xen_session *session, xen_vbd vbd, enum xen_vbd_mode mode);
-
-
-/**
- * Set the type field of the given VBD.
- */
-extern bool
-xen_vbd_set_type(xen_session *session, xen_vbd vbd, enum xen_vbd_type type);
-
-
-/**
- * Set the qos/algorithm_type field of the given VBD.
- */
-extern bool
-xen_vbd_set_qos_algorithm_type(xen_session *session, xen_vbd vbd, char *algorithm_type);
-
-
-/**
- * Set the qos/algorithm_params field of the given VBD.
- */
-extern bool
-xen_vbd_set_qos_algorithm_params(xen_session *session, xen_vbd vbd, xen_string_string_map *algorithm_params);
-
-
-/**
- * Add the given key-value pair to the qos/algorithm_params field of
- * the given VBD.
- */
-extern bool
-xen_vbd_add_to_qos_algorithm_params(xen_session *session, xen_vbd vbd, char *key, char *value);
-
-
-/**
- * Remove the given key and its corresponding value from the
- * qos/algorithm_params field of the given VBD.  If the key is not in that
- * Map, then do nothing.
- */
-extern bool
-xen_vbd_remove_from_qos_algorithm_params(xen_session *session, xen_vbd vbd, char *key);
-
-
-/**
- * Change the media in the device for CDROM-like devices only. For
- * other devices, detach the VBD and attach a new one
- */
-extern bool
-xen_vbd_media_change(xen_session *session, xen_vbd vbd, xen_vdi vdi);
-
-
-/**
- * Hotplug the specified VBD, dynamically attaching it to the running
- * VM
- */
-extern bool
-xen_vbd_plug(xen_session *session, xen_vbd self);
-
-
-/**
- * Hot-unplug the specified VBD, dynamically unattaching it from the
- * running VM
- */
-extern bool
-xen_vbd_unplug(xen_session *session, xen_vbd self);
-
-
-/**
- * Return a list of all the VBDs known to the system.
- */
-extern bool
-xen_vbd_get_all(xen_session *session, struct xen_vbd_set **result);
-
-
-#endif
diff --git a/tools/libxen/include/xen_vbd_decl.h b/tools/libxen/include/xen_vbd_decl.h
deleted file mode 100644 (file)
index c687786..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_VBD_DECL_H
-#define XEN_VBD_DECL_H
-
-typedef void *xen_vbd;
-
-struct xen_vbd_set;
-struct xen_vbd_record;
-struct xen_vbd_record_set;
-struct xen_vbd_record_opt;
-struct xen_vbd_record_opt_set;
-
-#endif
diff --git a/tools/libxen/include/xen_vbd_metrics.h b/tools/libxen/include/xen_vbd_metrics.h
deleted file mode 100644 (file)
index f1aa420..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_VBD_METRICS_H
-#define XEN_VBD_METRICS_H
-
-#include "xen_common.h"
-#include "xen_vbd_metrics_decl.h"
-
-
-/*
- * The VBD_metrics class.
- * 
- * The metrics associated with a virtual block device.
- */
-
-
-/**
- * Free the given xen_vbd_metrics.  The given handle must have been
- * allocated by this library.
- */
-extern void
-xen_vbd_metrics_free(xen_vbd_metrics vbd_metrics);
-
-
-typedef struct xen_vbd_metrics_set
-{
-    size_t size;
-    xen_vbd_metrics *contents[];
-} xen_vbd_metrics_set;
-
-/**
- * Allocate a xen_vbd_metrics_set of the given size.
- */
-extern xen_vbd_metrics_set *
-xen_vbd_metrics_set_alloc(size_t size);
-
-/**
- * Free the given xen_vbd_metrics_set.  The given set must have been
- * allocated by this library.
- */
-extern void
-xen_vbd_metrics_set_free(xen_vbd_metrics_set *set);
-
-
-typedef struct xen_vbd_metrics_record
-{
-    xen_vbd_metrics handle;
-    char *uuid;
-    double io_read_kbs;
-    double io_write_kbs;
-    time_t last_updated;
-} xen_vbd_metrics_record;
-
-/**
- * Allocate a xen_vbd_metrics_record.
- */
-extern xen_vbd_metrics_record *
-xen_vbd_metrics_record_alloc(void);
-
-/**
- * Free the given xen_vbd_metrics_record, and all referenced values. 
- * The given record must have been allocated by this library.
- */
-extern void
-xen_vbd_metrics_record_free(xen_vbd_metrics_record *record);
-
-
-typedef struct xen_vbd_metrics_record_opt
-{
-    bool is_record;
-    union
-    {
-        xen_vbd_metrics handle;
-        xen_vbd_metrics_record *record;
-    } u;
-} xen_vbd_metrics_record_opt;
-
-/**
- * Allocate a xen_vbd_metrics_record_opt.
- */
-extern xen_vbd_metrics_record_opt *
-xen_vbd_metrics_record_opt_alloc(void);
-
-/**
- * Free the given xen_vbd_metrics_record_opt, and all referenced
- * values.  The given record_opt must have been allocated by this library.
- */
-extern void
-xen_vbd_metrics_record_opt_free(xen_vbd_metrics_record_opt *record_opt);
-
-
-typedef struct xen_vbd_metrics_record_set
-{
-    size_t size;
-    xen_vbd_metrics_record *contents[];
-} xen_vbd_metrics_record_set;
-
-/**
- * Allocate a xen_vbd_metrics_record_set of the given size.
- */
-extern xen_vbd_metrics_record_set *
-xen_vbd_metrics_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_vbd_metrics_record_set, and all referenced
- * values.  The given set must have been allocated by this library.
- */
-extern void
-xen_vbd_metrics_record_set_free(xen_vbd_metrics_record_set *set);
-
-
-
-typedef struct xen_vbd_metrics_record_opt_set
-{
-    size_t size;
-    xen_vbd_metrics_record_opt *contents[];
-} xen_vbd_metrics_record_opt_set;
-
-/**
- * Allocate a xen_vbd_metrics_record_opt_set of the given size.
- */
-extern xen_vbd_metrics_record_opt_set *
-xen_vbd_metrics_record_opt_set_alloc(size_t size);
-
-/**
- * Free the given xen_vbd_metrics_record_opt_set, and all referenced
- * values.  The given set must have been allocated by this library.
- */
-extern void
-xen_vbd_metrics_record_opt_set_free(xen_vbd_metrics_record_opt_set *set);
-
-
-/**
- * Get a record containing the current state of the given VBD_metrics.
- */
-extern bool
-xen_vbd_metrics_get_record(xen_session *session, xen_vbd_metrics_record **result, xen_vbd_metrics vbd_metrics);
-
-
-/**
- * Get a reference to the VBD_metrics instance with the specified UUID.
- */
-extern bool
-xen_vbd_metrics_get_by_uuid(xen_session *session, xen_vbd_metrics *result, char *uuid);
-
-
-/**
- * Get the uuid field of the given VBD_metrics.
- */
-extern bool
-xen_vbd_metrics_get_uuid(xen_session *session, char **result, xen_vbd_metrics vbd_metrics);
-
-
-/**
- * Get the io/read_kbs field of the given VBD_metrics.
- */
-extern bool
-xen_vbd_metrics_get_io_read_kbs(xen_session *session, double *result, xen_vbd_metrics vbd_metrics);
-
-
-/**
- * Get the io/write_kbs field of the given VBD_metrics.
- */
-extern bool
-xen_vbd_metrics_get_io_write_kbs(xen_session *session, double *result, xen_vbd_metrics vbd_metrics);
-
-
-/**
- * Get the last_updated field of the given VBD_metrics.
- */
-extern bool
-xen_vbd_metrics_get_last_updated(xen_session *session, time_t *result, xen_vbd_metrics vbd_metrics);
-
-
-/**
- * Return a list of all the VBD_metrics instances known to the system.
- */
-extern bool
-xen_vbd_metrics_get_all(xen_session *session, struct xen_vbd_metrics_set **result);
-
-
-#endif
diff --git a/tools/libxen/include/xen_vbd_metrics_decl.h b/tools/libxen/include/xen_vbd_metrics_decl.h
deleted file mode 100644 (file)
index 501aa8f..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_VBD_METRICS_DECL_H
-#define XEN_VBD_METRICS_DECL_H
-
-typedef void *xen_vbd_metrics;
-
-struct xen_vbd_metrics_set;
-struct xen_vbd_metrics_record;
-struct xen_vbd_metrics_record_set;
-struct xen_vbd_metrics_record_opt;
-struct xen_vbd_metrics_record_opt_set;
-
-#endif
diff --git a/tools/libxen/include/xen_vbd_mode.h b/tools/libxen/include/xen_vbd_mode.h
deleted file mode 100644 (file)
index b0cd1c2..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_VBD_MODE_H
-#define XEN_VBD_MODE_H
-
-
-#include "xen_common.h"
-
-
-enum xen_vbd_mode
-{
-    /**
-     * disk is mounted read-only
-     */
-    XEN_VBD_MODE_RO,
-
-    /**
-     * disk is mounted read-write
-     */
-    XEN_VBD_MODE_RW
-};
-
-
-typedef struct xen_vbd_mode_set
-{
-    size_t size;
-    enum xen_vbd_mode contents[];
-} xen_vbd_mode_set;
-
-/**
- * Allocate a xen_vbd_mode_set of the given size.
- */
-extern xen_vbd_mode_set *
-xen_vbd_mode_set_alloc(size_t size);
-
-/**
- * Free the given xen_vbd_mode_set.  The given set must have been
- * allocated by this library.
- */
-extern void
-xen_vbd_mode_set_free(xen_vbd_mode_set *set);
-
-
-/**
- * Return the name corresponding to the given code.  This string must
- * not be modified or freed.
- */
-extern const char *
-xen_vbd_mode_to_string(enum xen_vbd_mode val);
-
-
-/**
- * Return the correct code for the given string, or set the session
- * object to failure and return an undefined value if the given string does
- * not match a known code.
- */
-extern enum xen_vbd_mode
-xen_vbd_mode_from_string(xen_session *session, const char *str);
-
-
-#endif
index 3efd4a63d504c76e0c5ba9093f677caac0a9bd0c..4f056811186a08d029415be093dc59b7d13c2bef 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, XenSource Inc.
+ * Copyright (c) 2006-2007, XenSource Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
diff --git a/tools/libxen/include/xen_vbd_type.h b/tools/libxen/include/xen_vbd_type.h
deleted file mode 100644 (file)
index 656fa16..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_VBD_TYPE_H
-#define XEN_VBD_TYPE_H
-
-
-#include "xen_common.h"
-
-
-enum xen_vbd_type
-{
-    /**
-     * VBD will appear to guest as CD
-     */
-    XEN_VBD_TYPE_CD,
-
-    /**
-     * VBD will appear to guest as disk
-     */
-    XEN_VBD_TYPE_DISK
-};
-
-
-typedef struct xen_vbd_type_set
-{
-    size_t size;
-    enum xen_vbd_type contents[];
-} xen_vbd_type_set;
-
-/**
- * Allocate a xen_vbd_type_set of the given size.
- */
-extern xen_vbd_type_set *
-xen_vbd_type_set_alloc(size_t size);
-
-/**
- * Free the given xen_vbd_type_set.  The given set must have been
- * allocated by this library.
- */
-extern void
-xen_vbd_type_set_free(xen_vbd_type_set *set);
-
-
-/**
- * Return the name corresponding to the given code.  This string must
- * not be modified or freed.
- */
-extern const char *
-xen_vbd_type_to_string(enum xen_vbd_type val);
-
-
-/**
- * Return the correct code for the given string, or set the session
- * object to failure and return an undefined value if the given string does
- * not match a known code.
- */
-extern enum xen_vbd_type
-xen_vbd_type_from_string(xen_session *session, const char *str);
-
-
-#endif
diff --git a/tools/libxen/include/xen_vdi.h b/tools/libxen/include/xen_vdi.h
deleted file mode 100644 (file)
index 74b6354..0000000
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_VDI_H
-#define XEN_VDI_H
-
-#include "xen_common.h"
-#include "xen_crashdump_decl.h"
-#include "xen_sr_decl.h"
-#include "xen_string_string_map.h"
-#include "xen_vbd_decl.h"
-#include "xen_vdi_decl.h"
-#include "xen_vdi_type.h"
-
-
-/*
- * The VDI class.
- * 
- * A virtual disk image.
- */
-
-
-/**
- * Free the given xen_vdi.  The given handle must have been allocated
- * by this library.
- */
-extern void
-xen_vdi_free(xen_vdi vdi);
-
-
-typedef struct xen_vdi_set
-{
-    size_t size;
-    xen_vdi *contents[];
-} xen_vdi_set;
-
-/**
- * Allocate a xen_vdi_set of the given size.
- */
-extern xen_vdi_set *
-xen_vdi_set_alloc(size_t size);
-
-/**
- * Free the given xen_vdi_set.  The given set must have been allocated
- * by this library.
- */
-extern void
-xen_vdi_set_free(xen_vdi_set *set);
-
-
-typedef struct xen_vdi_record
-{
-    xen_vdi handle;
-    char *uuid;
-    char *name_label;
-    char *name_description;
-    struct xen_sr_record_opt *sr;
-    struct xen_vbd_record_opt_set *vbds;
-    struct xen_crashdump_record_opt_set *crash_dumps;
-    int64_t virtual_size;
-    int64_t physical_utilisation;
-    enum xen_vdi_type type;
-    bool sharable;
-    bool read_only;
-    xen_string_string_map *other_config;
-} xen_vdi_record;
-
-/**
- * Allocate a xen_vdi_record.
- */
-extern xen_vdi_record *
-xen_vdi_record_alloc(void);
-
-/**
- * Free the given xen_vdi_record, and all referenced values.  The given
- * record must have been allocated by this library.
- */
-extern void
-xen_vdi_record_free(xen_vdi_record *record);
-
-
-typedef struct xen_vdi_record_opt
-{
-    bool is_record;
-    union
-    {
-        xen_vdi handle;
-        xen_vdi_record *record;
-    } u;
-} xen_vdi_record_opt;
-
-/**
- * Allocate a xen_vdi_record_opt.
- */
-extern xen_vdi_record_opt *
-xen_vdi_record_opt_alloc(void);
-
-/**
- * Free the given xen_vdi_record_opt, and all referenced values.  The
- * given record_opt must have been allocated by this library.
- */
-extern void
-xen_vdi_record_opt_free(xen_vdi_record_opt *record_opt);
-
-
-typedef struct xen_vdi_record_set
-{
-    size_t size;
-    xen_vdi_record *contents[];
-} xen_vdi_record_set;
-
-/**
- * Allocate a xen_vdi_record_set of the given size.
- */
-extern xen_vdi_record_set *
-xen_vdi_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_vdi_record_set, and all referenced values.  The
- * given set must have been allocated by this library.
- */
-extern void
-xen_vdi_record_set_free(xen_vdi_record_set *set);
-
-
-
-typedef struct xen_vdi_record_opt_set
-{
-    size_t size;
-    xen_vdi_record_opt *contents[];
-} xen_vdi_record_opt_set;
-
-/**
- * Allocate a xen_vdi_record_opt_set of the given size.
- */
-extern xen_vdi_record_opt_set *
-xen_vdi_record_opt_set_alloc(size_t size);
-
-/**
- * Free the given xen_vdi_record_opt_set, and all referenced values. 
- * The given set must have been allocated by this library.
- */
-extern void
-xen_vdi_record_opt_set_free(xen_vdi_record_opt_set *set);
-
-
-/**
- * Get a record containing the current state of the given VDI.
- */
-extern bool
-xen_vdi_get_record(xen_session *session, xen_vdi_record **result, xen_vdi vdi);
-
-
-/**
- * Get a reference to the VDI instance with the specified UUID.
- */
-extern bool
-xen_vdi_get_by_uuid(xen_session *session, xen_vdi *result, char *uuid);
-
-
-/**
- * Create a new VDI instance, and return its handle.
- */
-extern bool
-xen_vdi_create(xen_session *session, xen_vdi *result, xen_vdi_record *record);
-
-
-/**
- * Destroy the specified VDI instance.
- */
-extern bool
-xen_vdi_destroy(xen_session *session, xen_vdi vdi);
-
-
-/**
- * Get all the VDI instances with the given label.
- */
-extern bool
-xen_vdi_get_by_name_label(xen_session *session, struct xen_vdi_set **result, char *label);
-
-
-/**
- * Get the uuid field of the given VDI.
- */
-extern bool
-xen_vdi_get_uuid(xen_session *session, char **result, xen_vdi vdi);
-
-
-/**
- * Get the name/label field of the given VDI.
- */
-extern bool
-xen_vdi_get_name_label(xen_session *session, char **result, xen_vdi vdi);
-
-
-/**
- * Get the name/description field of the given VDI.
- */
-extern bool
-xen_vdi_get_name_description(xen_session *session, char **result, xen_vdi vdi);
-
-
-/**
- * Get the SR field of the given VDI.
- */
-extern bool
-xen_vdi_get_sr(xen_session *session, xen_sr *result, xen_vdi vdi);
-
-
-/**
- * Get the VBDs field of the given VDI.
- */
-extern bool
-xen_vdi_get_vbds(xen_session *session, struct xen_vbd_set **result, xen_vdi vdi);
-
-
-/**
- * Get the crash_dumps field of the given VDI.
- */
-extern bool
-xen_vdi_get_crash_dumps(xen_session *session, struct xen_crashdump_set **result, xen_vdi vdi);
-
-
-/**
- * Get the virtual_size field of the given VDI.
- */
-extern bool
-xen_vdi_get_virtual_size(xen_session *session, int64_t *result, xen_vdi vdi);
-
-
-/**
- * Get the physical_utilisation field of the given VDI.
- */
-extern bool
-xen_vdi_get_physical_utilisation(xen_session *session, int64_t *result, xen_vdi vdi);
-
-
-/**
- * Get the type field of the given VDI.
- */
-extern bool
-xen_vdi_get_type(xen_session *session, enum xen_vdi_type *result, xen_vdi vdi);
-
-
-/**
- * Get the sharable field of the given VDI.
- */
-extern bool
-xen_vdi_get_sharable(xen_session *session, bool *result, xen_vdi vdi);
-
-
-/**
- * Get the read_only field of the given VDI.
- */
-extern bool
-xen_vdi_get_read_only(xen_session *session, bool *result, xen_vdi vdi);
-
-
-/**
- * Get the other_config field of the given VDI.
- */
-extern bool
-xen_vdi_get_other_config(xen_session *session, xen_string_string_map **result, xen_vdi vdi);
-
-
-/**
- * Set the name/label field of the given VDI.
- */
-extern bool
-xen_vdi_set_name_label(xen_session *session, xen_vdi vdi, char *label);
-
-
-/**
- * Set the name/description field of the given VDI.
- */
-extern bool
-xen_vdi_set_name_description(xen_session *session, xen_vdi vdi, char *description);
-
-
-/**
- * Set the virtual_size field of the given VDI.
- */
-extern bool
-xen_vdi_set_virtual_size(xen_session *session, xen_vdi vdi, int64_t virtual_size);
-
-
-/**
- * Set the sharable field of the given VDI.
- */
-extern bool
-xen_vdi_set_sharable(xen_session *session, xen_vdi vdi, bool sharable);
-
-
-/**
- * Set the read_only field of the given VDI.
- */
-extern bool
-xen_vdi_set_read_only(xen_session *session, xen_vdi vdi, bool read_only);
-
-
-/**
- * Set the other_config field of the given VDI.
- */
-extern bool
-xen_vdi_set_other_config(xen_session *session, xen_vdi vdi, xen_string_string_map *other_config);
-
-
-/**
- * Add the given key-value pair to the other_config field of the given
- * VDI.
- */
-extern bool
-xen_vdi_add_to_other_config(xen_session *session, xen_vdi vdi, char *key, char *value);
-
-
-/**
- * Remove the given key and its corresponding value from the
- * other_config field of the given VDI.  If the key is not in that Map, then
- * do nothing.
- */
-extern bool
-xen_vdi_remove_from_other_config(xen_session *session, xen_vdi vdi, char *key);
-
-
-/**
- * Return a list of all the VDIs known to the system.
- */
-extern bool
-xen_vdi_get_all(xen_session *session, struct xen_vdi_set **result);
-
-
-#endif
diff --git a/tools/libxen/include/xen_vdi_decl.h b/tools/libxen/include/xen_vdi_decl.h
deleted file mode 100644 (file)
index 34692a2..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_VDI_DECL_H
-#define XEN_VDI_DECL_H
-
-typedef void *xen_vdi;
-
-struct xen_vdi_set;
-struct xen_vdi_record;
-struct xen_vdi_record_set;
-struct xen_vdi_record_opt;
-struct xen_vdi_record_opt_set;
-
-#endif
diff --git a/tools/libxen/include/xen_vdi_type.h b/tools/libxen/include/xen_vdi_type.h
deleted file mode 100644 (file)
index 0116849..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_VDI_TYPE_H
-#define XEN_VDI_TYPE_H
-
-
-#include "xen_common.h"
-
-
-enum xen_vdi_type
-{
-    /**
-     * a disk that may be replaced on upgrade
-     */
-    XEN_VDI_TYPE_SYSTEM,
-
-    /**
-     * a disk that is always preserved on upgrade
-     */
-    XEN_VDI_TYPE_USER,
-
-    /**
-     * a disk that may be reformatted on upgrade
-     */
-    XEN_VDI_TYPE_EPHEMERAL,
-
-    /**
-     * a disk that stores a suspend image
-     */
-    XEN_VDI_TYPE_SUSPEND,
-
-    /**
-     * a disk that stores VM crashdump information
-     */
-    XEN_VDI_TYPE_CRASHDUMP
-};
-
-
-typedef struct xen_vdi_type_set
-{
-    size_t size;
-    enum xen_vdi_type contents[];
-} xen_vdi_type_set;
-
-/**
- * Allocate a xen_vdi_type_set of the given size.
- */
-extern xen_vdi_type_set *
-xen_vdi_type_set_alloc(size_t size);
-
-/**
- * Free the given xen_vdi_type_set.  The given set must have been
- * allocated by this library.
- */
-extern void
-xen_vdi_type_set_free(xen_vdi_type_set *set);
-
-
-/**
- * Return the name corresponding to the given code.  This string must
- * not be modified or freed.
- */
-extern const char *
-xen_vdi_type_to_string(enum xen_vdi_type val);
-
-
-/**
- * Return the correct code for the given string, or set the session
- * object to failure and return an undefined value if the given string does
- * not match a known code.
- */
-extern enum xen_vdi_type
-xen_vdi_type_from_string(xen_session *session, const char *str);
-
-
-#endif
index 1de23c8c831c229ec781d48bc520561f4662f61d..9c575ffaab532e4eb54159004775561cd117d34a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, XenSource Inc.
+ * Copyright (c) 2006-2007, XenSource Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
diff --git a/tools/libxen/include/xen_vif.h b/tools/libxen/include/xen_vif.h
deleted file mode 100644 (file)
index e9ad6b4..0000000
+++ /dev/null
@@ -1,365 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_VIF_H
-#define XEN_VIF_H
-
-#include "xen_common.h"
-#include "xen_network_decl.h"
-#include "xen_string_set.h"
-#include "xen_string_string_map.h"
-#include "xen_vif_decl.h"
-#include "xen_vif_metrics_decl.h"
-#include "xen_vm_decl.h"
-
-
-/*
- * The VIF class.
- * 
- * A virtual network interface.
- */
-
-
-/**
- * Free the given xen_vif.  The given handle must have been allocated
- * by this library.
- */
-extern void
-xen_vif_free(xen_vif vif);
-
-
-typedef struct xen_vif_set
-{
-    size_t size;
-    xen_vif *contents[];
-} xen_vif_set;
-
-/**
- * Allocate a xen_vif_set of the given size.
- */
-extern xen_vif_set *
-xen_vif_set_alloc(size_t size);
-
-/**
- * Free the given xen_vif_set.  The given set must have been allocated
- * by this library.
- */
-extern void
-xen_vif_set_free(xen_vif_set *set);
-
-
-typedef struct xen_vif_record
-{
-    xen_vif handle;
-    char *uuid;
-    char *device;
-    struct xen_network_record_opt *network;
-    struct xen_vm_record_opt *vm;
-    char *mac;
-    int64_t mtu;
-    bool currently_attached;
-    int64_t status_code;
-    char *status_detail;
-    xen_string_string_map *runtime_properties;
-    char *qos_algorithm_type;
-    xen_string_string_map *qos_algorithm_params;
-    struct xen_string_set *qos_supported_algorithms;
-    struct xen_vif_metrics_record_opt *metrics;
-} xen_vif_record;
-
-/**
- * Allocate a xen_vif_record.
- */
-extern xen_vif_record *
-xen_vif_record_alloc(void);
-
-/**
- * Free the given xen_vif_record, and all referenced values.  The given
- * record must have been allocated by this library.
- */
-extern void
-xen_vif_record_free(xen_vif_record *record);
-
-
-typedef struct xen_vif_record_opt
-{
-    bool is_record;
-    union
-    {
-        xen_vif handle;
-        xen_vif_record *record;
-    } u;
-} xen_vif_record_opt;
-
-/**
- * Allocate a xen_vif_record_opt.
- */
-extern xen_vif_record_opt *
-xen_vif_record_opt_alloc(void);
-
-/**
- * Free the given xen_vif_record_opt, and all referenced values.  The
- * given record_opt must have been allocated by this library.
- */
-extern void
-xen_vif_record_opt_free(xen_vif_record_opt *record_opt);
-
-
-typedef struct xen_vif_record_set
-{
-    size_t size;
-    xen_vif_record *contents[];
-} xen_vif_record_set;
-
-/**
- * Allocate a xen_vif_record_set of the given size.
- */
-extern xen_vif_record_set *
-xen_vif_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_vif_record_set, and all referenced values.  The
- * given set must have been allocated by this library.
- */
-extern void
-xen_vif_record_set_free(xen_vif_record_set *set);
-
-
-
-typedef struct xen_vif_record_opt_set
-{
-    size_t size;
-    xen_vif_record_opt *contents[];
-} xen_vif_record_opt_set;
-
-/**
- * Allocate a xen_vif_record_opt_set of the given size.
- */
-extern xen_vif_record_opt_set *
-xen_vif_record_opt_set_alloc(size_t size);
-
-/**
- * Free the given xen_vif_record_opt_set, and all referenced values. 
- * The given set must have been allocated by this library.
- */
-extern void
-xen_vif_record_opt_set_free(xen_vif_record_opt_set *set);
-
-
-/**
- * Get a record containing the current state of the given VIF.
- */
-extern bool
-xen_vif_get_record(xen_session *session, xen_vif_record **result, xen_vif vif);
-
-
-/**
- * Get a reference to the VIF instance with the specified UUID.
- */
-extern bool
-xen_vif_get_by_uuid(xen_session *session, xen_vif *result, char *uuid);
-
-
-/**
- * Create a new VIF instance, and return its handle.
- */
-extern bool
-xen_vif_create(xen_session *session, xen_vif *result, xen_vif_record *record);
-
-
-/**
- * Destroy the specified VIF instance.
- */
-extern bool
-xen_vif_destroy(xen_session *session, xen_vif vif);
-
-
-/**
- * Get the uuid field of the given VIF.
- */
-extern bool
-xen_vif_get_uuid(xen_session *session, char **result, xen_vif vif);
-
-
-/**
- * Get the device field of the given VIF.
- */
-extern bool
-xen_vif_get_device(xen_session *session, char **result, xen_vif vif);
-
-
-/**
- * Get the network field of the given VIF.
- */
-extern bool
-xen_vif_get_network(xen_session *session, xen_network *result, xen_vif vif);
-
-
-/**
- * Get the VM field of the given VIF.
- */
-extern bool
-xen_vif_get_vm(xen_session *session, xen_vm *result, xen_vif vif);
-
-
-/**
- * Get the MAC field of the given VIF.
- */
-extern bool
-xen_vif_get_mac(xen_session *session, char **result, xen_vif vif);
-
-
-/**
- * Get the MTU field of the given VIF.
- */
-extern bool
-xen_vif_get_mtu(xen_session *session, int64_t *result, xen_vif vif);
-
-
-/**
- * Get the currently_attached field of the given VIF.
- */
-extern bool
-xen_vif_get_currently_attached(xen_session *session, bool *result, xen_vif vif);
-
-
-/**
- * Get the status_code field of the given VIF.
- */
-extern bool
-xen_vif_get_status_code(xen_session *session, int64_t *result, xen_vif vif);
-
-
-/**
- * Get the status_detail field of the given VIF.
- */
-extern bool
-xen_vif_get_status_detail(xen_session *session, char **result, xen_vif vif);
-
-
-/**
- * Get the runtime_properties field of the given VIF.
- */
-extern bool
-xen_vif_get_runtime_properties(xen_session *session, xen_string_string_map **result, xen_vif vif);
-
-
-/**
- * Get the qos/algorithm_type field of the given VIF.
- */
-extern bool
-xen_vif_get_qos_algorithm_type(xen_session *session, char **result, xen_vif vif);
-
-
-/**
- * Get the qos/algorithm_params field of the given VIF.
- */
-extern bool
-xen_vif_get_qos_algorithm_params(xen_session *session, xen_string_string_map **result, xen_vif vif);
-
-
-/**
- * Get the qos/supported_algorithms field of the given VIF.
- */
-extern bool
-xen_vif_get_qos_supported_algorithms(xen_session *session, struct xen_string_set **result, xen_vif vif);
-
-
-/**
- * Get the metrics field of the given VIF.
- */
-extern bool
-xen_vif_get_metrics(xen_session *session, xen_vif_metrics *result, xen_vif vif);
-
-
-/**
- * Set the device field of the given VIF.
- */
-extern bool
-xen_vif_set_device(xen_session *session, xen_vif vif, char *device);
-
-
-/**
- * Set the MAC field of the given VIF.
- */
-extern bool
-xen_vif_set_mac(xen_session *session, xen_vif vif, char *mac);
-
-
-/**
- * Set the MTU field of the given VIF.
- */
-extern bool
-xen_vif_set_mtu(xen_session *session, xen_vif vif, int64_t mtu);
-
-
-/**
- * Set the qos/algorithm_type field of the given VIF.
- */
-extern bool
-xen_vif_set_qos_algorithm_type(xen_session *session, xen_vif vif, char *algorithm_type);
-
-
-/**
- * Set the qos/algorithm_params field of the given VIF.
- */
-extern bool
-xen_vif_set_qos_algorithm_params(xen_session *session, xen_vif vif, xen_string_string_map *algorithm_params);
-
-
-/**
- * Add the given key-value pair to the qos/algorithm_params field of
- * the given VIF.
- */
-extern bool
-xen_vif_add_to_qos_algorithm_params(xen_session *session, xen_vif vif, char *key, char *value);
-
-
-/**
- * Remove the given key and its corresponding value from the
- * qos/algorithm_params field of the given VIF.  If the key is not in that
- * Map, then do nothing.
- */
-extern bool
-xen_vif_remove_from_qos_algorithm_params(xen_session *session, xen_vif vif, char *key);
-
-
-/**
- * Hotplug the specified VIF, dynamically attaching it to the running
- * VM.
- */
-extern bool
-xen_vif_plug(xen_session *session, xen_vif self);
-
-
-/**
- * Hot-unplug the specified VIF, dynamically unattaching it from the
- * running VM.
- */
-extern bool
-xen_vif_unplug(xen_session *session, xen_vif self);
-
-
-/**
- * Return a list of all the VIFs known to the system.
- */
-extern bool
-xen_vif_get_all(xen_session *session, struct xen_vif_set **result);
-
-
-#endif
diff --git a/tools/libxen/include/xen_vif_decl.h b/tools/libxen/include/xen_vif_decl.h
deleted file mode 100644 (file)
index 6a130f7..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_VIF_DECL_H
-#define XEN_VIF_DECL_H
-
-typedef void *xen_vif;
-
-struct xen_vif_set;
-struct xen_vif_record;
-struct xen_vif_record_set;
-struct xen_vif_record_opt;
-struct xen_vif_record_opt_set;
-
-#endif
diff --git a/tools/libxen/include/xen_vif_metrics.h b/tools/libxen/include/xen_vif_metrics.h
deleted file mode 100644 (file)
index 2febab4..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_VIF_METRICS_H
-#define XEN_VIF_METRICS_H
-
-#include "xen_common.h"
-#include "xen_vif_metrics_decl.h"
-
-
-/*
- * The VIF_metrics class.
- * 
- * The metrics associated with a virtual network device.
- */
-
-
-/**
- * Free the given xen_vif_metrics.  The given handle must have been
- * allocated by this library.
- */
-extern void
-xen_vif_metrics_free(xen_vif_metrics vif_metrics);
-
-
-typedef struct xen_vif_metrics_set
-{
-    size_t size;
-    xen_vif_metrics *contents[];
-} xen_vif_metrics_set;
-
-/**
- * Allocate a xen_vif_metrics_set of the given size.
- */
-extern xen_vif_metrics_set *
-xen_vif_metrics_set_alloc(size_t size);
-
-/**
- * Free the given xen_vif_metrics_set.  The given set must have been
- * allocated by this library.
- */
-extern void
-xen_vif_metrics_set_free(xen_vif_metrics_set *set);
-
-
-typedef struct xen_vif_metrics_record
-{
-    xen_vif_metrics handle;
-    char *uuid;
-    double io_read_kbs;
-    double io_write_kbs;
-    time_t last_updated;
-} xen_vif_metrics_record;
-
-/**
- * Allocate a xen_vif_metrics_record.
- */
-extern xen_vif_metrics_record *
-xen_vif_metrics_record_alloc(void);
-
-/**
- * Free the given xen_vif_metrics_record, and all referenced values. 
- * The given record must have been allocated by this library.
- */
-extern void
-xen_vif_metrics_record_free(xen_vif_metrics_record *record);
-
-
-typedef struct xen_vif_metrics_record_opt
-{
-    bool is_record;
-    union
-    {
-        xen_vif_metrics handle;
-        xen_vif_metrics_record *record;
-    } u;
-} xen_vif_metrics_record_opt;
-
-/**
- * Allocate a xen_vif_metrics_record_opt.
- */
-extern xen_vif_metrics_record_opt *
-xen_vif_metrics_record_opt_alloc(void);
-
-/**
- * Free the given xen_vif_metrics_record_opt, and all referenced
- * values.  The given record_opt must have been allocated by this library.
- */
-extern void
-xen_vif_metrics_record_opt_free(xen_vif_metrics_record_opt *record_opt);
-
-
-typedef struct xen_vif_metrics_record_set
-{
-    size_t size;
-    xen_vif_metrics_record *contents[];
-} xen_vif_metrics_record_set;
-
-/**
- * Allocate a xen_vif_metrics_record_set of the given size.
- */
-extern xen_vif_metrics_record_set *
-xen_vif_metrics_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_vif_metrics_record_set, and all referenced
- * values.  The given set must have been allocated by this library.
- */
-extern void
-xen_vif_metrics_record_set_free(xen_vif_metrics_record_set *set);
-
-
-
-typedef struct xen_vif_metrics_record_opt_set
-{
-    size_t size;
-    xen_vif_metrics_record_opt *contents[];
-} xen_vif_metrics_record_opt_set;
-
-/**
- * Allocate a xen_vif_metrics_record_opt_set of the given size.
- */
-extern xen_vif_metrics_record_opt_set *
-xen_vif_metrics_record_opt_set_alloc(size_t size);
-
-/**
- * Free the given xen_vif_metrics_record_opt_set, and all referenced
- * values.  The given set must have been allocated by this library.
- */
-extern void
-xen_vif_metrics_record_opt_set_free(xen_vif_metrics_record_opt_set *set);
-
-
-/**
- * Get a record containing the current state of the given VIF_metrics.
- */
-extern bool
-xen_vif_metrics_get_record(xen_session *session, xen_vif_metrics_record **result, xen_vif_metrics vif_metrics);
-
-
-/**
- * Get a reference to the VIF_metrics instance with the specified UUID.
- */
-extern bool
-xen_vif_metrics_get_by_uuid(xen_session *session, xen_vif_metrics *result, char *uuid);
-
-
-/**
- * Get the uuid field of the given VIF_metrics.
- */
-extern bool
-xen_vif_metrics_get_uuid(xen_session *session, char **result, xen_vif_metrics vif_metrics);
-
-
-/**
- * Get the io/read_kbs field of the given VIF_metrics.
- */
-extern bool
-xen_vif_metrics_get_io_read_kbs(xen_session *session, double *result, xen_vif_metrics vif_metrics);
-
-
-/**
- * Get the io/write_kbs field of the given VIF_metrics.
- */
-extern bool
-xen_vif_metrics_get_io_write_kbs(xen_session *session, double *result, xen_vif_metrics vif_metrics);
-
-
-/**
- * Get the last_updated field of the given VIF_metrics.
- */
-extern bool
-xen_vif_metrics_get_last_updated(xen_session *session, time_t *result, xen_vif_metrics vif_metrics);
-
-
-/**
- * Return a list of all the VIF_metrics instances known to the system.
- */
-extern bool
-xen_vif_metrics_get_all(xen_session *session, struct xen_vif_metrics_set **result);
-
-
-#endif
diff --git a/tools/libxen/include/xen_vif_metrics_decl.h b/tools/libxen/include/xen_vif_metrics_decl.h
deleted file mode 100644 (file)
index 5734723..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_VIF_METRICS_DECL_H
-#define XEN_VIF_METRICS_DECL_H
-
-typedef void *xen_vif_metrics;
-
-struct xen_vif_metrics_set;
-struct xen_vif_metrics_record;
-struct xen_vif_metrics_record_set;
-struct xen_vif_metrics_record_opt;
-struct xen_vif_metrics_record_opt_set;
-
-#endif
diff --git a/tools/libxen/include/xen_vm.h b/tools/libxen/include/xen_vm.h
deleted file mode 100644 (file)
index d33f31b..0000000
+++ /dev/null
@@ -1,894 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_VM_H
-#define XEN_VM_H
-
-#include "xen_common.h"
-#include "xen_console_decl.h"
-#include "xen_crashdump_decl.h"
-#include "xen_host_decl.h"
-#include "xen_on_crash_behaviour.h"
-#include "xen_on_normal_exit.h"
-#include "xen_string_string_map.h"
-#include "xen_vbd_decl.h"
-#include "xen_vdi_decl.h"
-#include "xen_vif_decl.h"
-#include "xen_vm_decl.h"
-#include "xen_vm_guest_metrics_decl.h"
-#include "xen_vm_metrics_decl.h"
-#include "xen_vm_power_state.h"
-#include "xen_vtpm_decl.h"
-
-
-/*
- * The VM class.
- * 
- * A virtual machine (or 'guest').
- */
-
-
-/**
- * Free the given xen_vm.  The given handle must have been allocated by
- * this library.
- */
-extern void
-xen_vm_free(xen_vm vm);
-
-
-typedef struct xen_vm_set
-{
-    size_t size;
-    xen_vm *contents[];
-} xen_vm_set;
-
-/**
- * Allocate a xen_vm_set of the given size.
- */
-extern xen_vm_set *
-xen_vm_set_alloc(size_t size);
-
-/**
- * Free the given xen_vm_set.  The given set must have been allocated
- * by this library.
- */
-extern void
-xen_vm_set_free(xen_vm_set *set);
-
-
-typedef struct xen_vm_record
-{
-    xen_vm handle;
-    char *uuid;
-    enum xen_vm_power_state power_state;
-    char *name_label;
-    char *name_description;
-    int64_t user_version;
-    bool is_a_template;
-    bool auto_power_on;
-    struct xen_vdi_record_opt *suspend_vdi;
-    struct xen_host_record_opt *resident_on;
-    int64_t memory_static_max;
-    int64_t memory_dynamic_max;
-    int64_t memory_dynamic_min;
-    int64_t memory_static_min;
-    xen_string_string_map *vcpus_params;
-    int64_t vcpus_max;
-    int64_t vcpus_at_startup;
-    enum xen_on_normal_exit actions_after_shutdown;
-    enum xen_on_normal_exit actions_after_reboot;
-    enum xen_on_crash_behaviour actions_after_crash;
-    struct xen_console_record_opt_set *consoles;
-    struct xen_vif_record_opt_set *vifs;
-    struct xen_vbd_record_opt_set *vbds;
-    struct xen_crashdump_record_opt_set *crash_dumps;
-    struct xen_vtpm_record_opt_set *vtpms;
-    char *pv_bootloader;
-    char *pv_kernel;
-    char *pv_ramdisk;
-    char *pv_args;
-    char *pv_bootloader_args;
-    char *hvm_boot_policy;
-    xen_string_string_map *hvm_boot_params;
-    xen_string_string_map *platform;
-    char *pci_bus;
-    xen_string_string_map *other_config;
-    int64_t domid;
-    bool is_control_domain;
-    struct xen_vm_metrics_record_opt *metrics;
-    struct xen_vm_guest_metrics_record_opt *guest_metrics;
-} xen_vm_record;
-
-/**
- * Allocate a xen_vm_record.
- */
-extern xen_vm_record *
-xen_vm_record_alloc(void);
-
-/**
- * Free the given xen_vm_record, and all referenced values.  The given
- * record must have been allocated by this library.
- */
-extern void
-xen_vm_record_free(xen_vm_record *record);
-
-
-typedef struct xen_vm_record_opt
-{
-    bool is_record;
-    union
-    {
-        xen_vm handle;
-        xen_vm_record *record;
-    } u;
-} xen_vm_record_opt;
-
-/**
- * Allocate a xen_vm_record_opt.
- */
-extern xen_vm_record_opt *
-xen_vm_record_opt_alloc(void);
-
-/**
- * Free the given xen_vm_record_opt, and all referenced values.  The
- * given record_opt must have been allocated by this library.
- */
-extern void
-xen_vm_record_opt_free(xen_vm_record_opt *record_opt);
-
-
-typedef struct xen_vm_record_set
-{
-    size_t size;
-    xen_vm_record *contents[];
-} xen_vm_record_set;
-
-/**
- * Allocate a xen_vm_record_set of the given size.
- */
-extern xen_vm_record_set *
-xen_vm_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_vm_record_set, and all referenced values.  The
- * given set must have been allocated by this library.
- */
-extern void
-xen_vm_record_set_free(xen_vm_record_set *set);
-
-
-
-typedef struct xen_vm_record_opt_set
-{
-    size_t size;
-    xen_vm_record_opt *contents[];
-} xen_vm_record_opt_set;
-
-/**
- * Allocate a xen_vm_record_opt_set of the given size.
- */
-extern xen_vm_record_opt_set *
-xen_vm_record_opt_set_alloc(size_t size);
-
-/**
- * Free the given xen_vm_record_opt_set, and all referenced values. 
- * The given set must have been allocated by this library.
- */
-extern void
-xen_vm_record_opt_set_free(xen_vm_record_opt_set *set);
-
-
-/**
- * Get a record containing the current state of the given VM.
- */
-extern bool
-xen_vm_get_record(xen_session *session, xen_vm_record **result, xen_vm vm);
-
-
-/**
- * Get a reference to the VM instance with the specified UUID.
- */
-extern bool
-xen_vm_get_by_uuid(xen_session *session, xen_vm *result, char *uuid);
-
-
-/**
- * Create a new VM instance, and return its handle.
- */
-extern bool
-xen_vm_create(xen_session *session, xen_vm *result, xen_vm_record *record);
-
-
-/**
- * Destroy the specified VM.  The VM is completely removed from the
- * system.  This function can only be called when the VM is in the Halted
- * State.
- */
-extern bool
-xen_vm_destroy(xen_session *session, xen_vm vm);
-
-
-/**
- * Get all the VM instances with the given label.
- */
-extern bool
-xen_vm_get_by_name_label(xen_session *session, struct xen_vm_set **result, char *label);
-
-
-/**
- * Get the uuid field of the given VM.
- */
-extern bool
-xen_vm_get_uuid(xen_session *session, char **result, xen_vm vm);
-
-
-/**
- * Get the power_state field of the given VM.
- */
-extern bool
-xen_vm_get_power_state(xen_session *session, enum xen_vm_power_state *result, xen_vm vm);
-
-
-/**
- * Get the name/label field of the given VM.
- */
-extern bool
-xen_vm_get_name_label(xen_session *session, char **result, xen_vm vm);
-
-
-/**
- * Get the name/description field of the given VM.
- */
-extern bool
-xen_vm_get_name_description(xen_session *session, char **result, xen_vm vm);
-
-
-/**
- * Get the user_version field of the given VM.
- */
-extern bool
-xen_vm_get_user_version(xen_session *session, int64_t *result, xen_vm vm);
-
-
-/**
- * Get the is_a_template field of the given VM.
- */
-extern bool
-xen_vm_get_is_a_template(xen_session *session, bool *result, xen_vm vm);
-
-
-/**
- * Get the auto_power_on field of the given VM.
- */
-extern bool
-xen_vm_get_auto_power_on(xen_session *session, bool *result, xen_vm vm);
-
-
-/**
- * Get the suspend_VDI field of the given VM.
- */
-extern bool
-xen_vm_get_suspend_vdi(xen_session *session, xen_vdi *result, xen_vm vm);
-
-
-/**
- * Get the resident_on field of the given VM.
- */
-extern bool
-xen_vm_get_resident_on(xen_session *session, xen_host *result, xen_vm vm);
-
-
-/**
- * Get the memory/static_max field of the given VM.
- */
-extern bool
-xen_vm_get_memory_static_max(xen_session *session, int64_t *result, xen_vm vm);
-
-
-/**
- * Get the memory/dynamic_max field of the given VM.
- */
-extern bool
-xen_vm_get_memory_dynamic_max(xen_session *session, int64_t *result, xen_vm vm);
-
-
-/**
- * Get the memory/dynamic_min field of the given VM.
- */
-extern bool
-xen_vm_get_memory_dynamic_min(xen_session *session, int64_t *result, xen_vm vm);
-
-
-/**
- * Get the memory/static_min field of the given VM.
- */
-extern bool
-xen_vm_get_memory_static_min(xen_session *session, int64_t *result, xen_vm vm);
-
-
-/**
- * Get the VCPUs/params field of the given VM.
- */
-extern bool
-xen_vm_get_vcpus_params(xen_session *session, xen_string_string_map **result, xen_vm vm);
-
-
-/**
- * Get the VCPUs/max field of the given VM.
- */
-extern bool
-xen_vm_get_vcpus_max(xen_session *session, int64_t *result, xen_vm vm);
-
-
-/**
- * Get the VCPUs/at_startup field of the given VM.
- */
-extern bool
-xen_vm_get_vcpus_at_startup(xen_session *session, int64_t *result, xen_vm vm);
-
-
-/**
- * Get the actions/after_shutdown field of the given VM.
- */
-extern bool
-xen_vm_get_actions_after_shutdown(xen_session *session, enum xen_on_normal_exit *result, xen_vm vm);
-
-
-/**
- * Get the actions/after_reboot field of the given VM.
- */
-extern bool
-xen_vm_get_actions_after_reboot(xen_session *session, enum xen_on_normal_exit *result, xen_vm vm);
-
-
-/**
- * Get the actions/after_crash field of the given VM.
- */
-extern bool
-xen_vm_get_actions_after_crash(xen_session *session, enum xen_on_crash_behaviour *result, xen_vm vm);
-
-
-/**
- * Get the consoles field of the given VM.
- */
-extern bool
-xen_vm_get_consoles(xen_session *session, struct xen_console_set **result, xen_vm vm);
-
-
-/**
- * Get the VIFs field of the given VM.
- */
-extern bool
-xen_vm_get_vifs(xen_session *session, struct xen_vif_set **result, xen_vm vm);
-
-
-/**
- * Get the VBDs field of the given VM.
- */
-extern bool
-xen_vm_get_vbds(xen_session *session, struct xen_vbd_set **result, xen_vm vm);
-
-
-/**
- * Get the crash_dumps field of the given VM.
- */
-extern bool
-xen_vm_get_crash_dumps(xen_session *session, struct xen_crashdump_set **result, xen_vm vm);
-
-
-/**
- * Get the VTPMs field of the given VM.
- */
-extern bool
-xen_vm_get_vtpms(xen_session *session, struct xen_vtpm_set **result, xen_vm vm);
-
-
-/**
- * Get the PV/bootloader field of the given VM.
- */
-extern bool
-xen_vm_get_pv_bootloader(xen_session *session, char **result, xen_vm vm);
-
-
-/**
- * Get the PV/kernel field of the given VM.
- */
-extern bool
-xen_vm_get_pv_kernel(xen_session *session, char **result, xen_vm vm);
-
-
-/**
- * Get the PV/ramdisk field of the given VM.
- */
-extern bool
-xen_vm_get_pv_ramdisk(xen_session *session, char **result, xen_vm vm);
-
-
-/**
- * Get the PV/args field of the given VM.
- */
-extern bool
-xen_vm_get_pv_args(xen_session *session, char **result, xen_vm vm);
-
-
-/**
- * Get the PV/bootloader_args field of the given VM.
- */
-extern bool
-xen_vm_get_pv_bootloader_args(xen_session *session, char **result, xen_vm vm);
-
-
-/**
- * Get the HVM/boot_policy field of the given VM.
- */
-extern bool
-xen_vm_get_hvm_boot_policy(xen_session *session, char **result, xen_vm vm);
-
-
-/**
- * Get the HVM/boot_params field of the given VM.
- */
-extern bool
-xen_vm_get_hvm_boot_params(xen_session *session, xen_string_string_map **result, xen_vm vm);
-
-
-/**
- * Get the platform field of the given VM.
- */
-extern bool
-xen_vm_get_platform(xen_session *session, xen_string_string_map **result, xen_vm vm);
-
-
-/**
- * Get the PCI_bus field of the given VM.
- */
-extern bool
-xen_vm_get_pci_bus(xen_session *session, char **result, xen_vm vm);
-
-
-/**
- * Get the other_config field of the given VM.
- */
-extern bool
-xen_vm_get_other_config(xen_session *session, xen_string_string_map **result, xen_vm vm);
-
-
-/**
- * Get the domid field of the given VM.
- */
-extern bool
-xen_vm_get_domid(xen_session *session, int64_t *result, xen_vm vm);
-
-
-/**
- * Get the is_control_domain field of the given VM.
- */
-extern bool
-xen_vm_get_is_control_domain(xen_session *session, bool *result, xen_vm vm);
-
-
-/**
- * Get the metrics field of the given VM.
- */
-extern bool
-xen_vm_get_metrics(xen_session *session, xen_vm_metrics *result, xen_vm vm);
-
-
-/**
- * Get the guest_metrics field of the given VM.
- */
-extern bool
-xen_vm_get_guest_metrics(xen_session *session, xen_vm_guest_metrics *result, xen_vm vm);
-
-
-/**
- * Set the name/label field of the given VM.
- */
-extern bool
-xen_vm_set_name_label(xen_session *session, xen_vm vm, char *label);
-
-
-/**
- * Set the name/description field of the given VM.
- */
-extern bool
-xen_vm_set_name_description(xen_session *session, xen_vm vm, char *description);
-
-
-/**
- * Set the user_version field of the given VM.
- */
-extern bool
-xen_vm_set_user_version(xen_session *session, xen_vm vm, int64_t user_version);
-
-
-/**
- * Set the is_a_template field of the given VM.
- */
-extern bool
-xen_vm_set_is_a_template(xen_session *session, xen_vm vm, bool is_a_template);
-
-
-/**
- * Set the auto_power_on field of the given VM.
- */
-extern bool
-xen_vm_set_auto_power_on(xen_session *session, xen_vm vm, bool auto_power_on);
-
-
-/**
- * Set the memory/static_max field of the given VM.
- */
-extern bool
-xen_vm_set_memory_static_max(xen_session *session, xen_vm vm, int64_t static_max);
-
-
-/**
- * Set the memory/dynamic_max field of the given VM.
- */
-extern bool
-xen_vm_set_memory_dynamic_max(xen_session *session, xen_vm vm, int64_t dynamic_max);
-
-
-/**
- * Set the memory/dynamic_min field of the given VM.
- */
-extern bool
-xen_vm_set_memory_dynamic_min(xen_session *session, xen_vm vm, int64_t dynamic_min);
-
-
-/**
- * Set the memory/static_min field of the given VM.
- */
-extern bool
-xen_vm_set_memory_static_min(xen_session *session, xen_vm vm, int64_t static_min);
-
-
-/**
- * Set the VCPUs/params field of the given VM.
- */
-extern bool
-xen_vm_set_vcpus_params(xen_session *session, xen_vm vm, xen_string_string_map *params);
-
-
-/**
- * Add the given key-value pair to the VCPUs/params field of the given
- * VM.
- */
-extern bool
-xen_vm_add_to_vcpus_params(xen_session *session, xen_vm vm, char *key, char *value);
-
-
-/**
- * Remove the given key and its corresponding value from the
- * VCPUs/params field of the given VM.  If the key is not in that Map, then do
- * nothing.
- */
-extern bool
-xen_vm_remove_from_vcpus_params(xen_session *session, xen_vm vm, char *key);
-
-
-/**
- * Set the VCPUs/max field of the given VM.
- */
-extern bool
-xen_vm_set_vcpus_max(xen_session *session, xen_vm vm, int64_t max);
-
-
-/**
- * Set the VCPUs/at_startup field of the given VM.
- */
-extern bool
-xen_vm_set_vcpus_at_startup(xen_session *session, xen_vm vm, int64_t at_startup);
-
-
-/**
- * Set the actions/after_shutdown field of the given VM.
- */
-extern bool
-xen_vm_set_actions_after_shutdown(xen_session *session, xen_vm vm, enum xen_on_normal_exit after_shutdown);
-
-
-/**
- * Set the actions/after_reboot field of the given VM.
- */
-extern bool
-xen_vm_set_actions_after_reboot(xen_session *session, xen_vm vm, enum xen_on_normal_exit after_reboot);
-
-
-/**
- * Set the actions/after_crash field of the given VM.
- */
-extern bool
-xen_vm_set_actions_after_crash(xen_session *session, xen_vm vm, enum xen_on_crash_behaviour after_crash);
-
-
-/**
- * Set the PV/bootloader field of the given VM.
- */
-extern bool
-xen_vm_set_pv_bootloader(xen_session *session, xen_vm vm, char *bootloader);
-
-
-/**
- * Set the PV/kernel field of the given VM.
- */
-extern bool
-xen_vm_set_pv_kernel(xen_session *session, xen_vm vm, char *kernel);
-
-
-/**
- * Set the PV/ramdisk field of the given VM.
- */
-extern bool
-xen_vm_set_pv_ramdisk(xen_session *session, xen_vm vm, char *ramdisk);
-
-
-/**
- * Set the PV/args field of the given VM.
- */
-extern bool
-xen_vm_set_pv_args(xen_session *session, xen_vm vm, char *args);
-
-
-/**
- * Set the PV/bootloader_args field of the given VM.
- */
-extern bool
-xen_vm_set_pv_bootloader_args(xen_session *session, xen_vm vm, char *bootloader_args);
-
-
-/**
- * Set the HVM/boot_policy field of the given VM.
- */
-extern bool
-xen_vm_set_hvm_boot_policy(xen_session *session, xen_vm vm, char *boot_policy);
-
-
-/**
- * Set the HVM/boot_params field of the given VM.
- */
-extern bool
-xen_vm_set_hvm_boot_params(xen_session *session, xen_vm vm, xen_string_string_map *boot_params);
-
-
-/**
- * Add the given key-value pair to the HVM/boot_params field of the
- * given VM.
- */
-extern bool
-xen_vm_add_to_hvm_boot_params(xen_session *session, xen_vm vm, char *key, char *value);
-
-
-/**
- * Remove the given key and its corresponding value from the
- * HVM/boot_params field of the given VM.  If the key is not in that Map, then
- * do nothing.
- */
-extern bool
-xen_vm_remove_from_hvm_boot_params(xen_session *session, xen_vm vm, char *key);
-
-
-/**
- * Set the platform field of the given VM.
- */
-extern bool
-xen_vm_set_platform(xen_session *session, xen_vm vm, xen_string_string_map *platform);
-
-
-/**
- * Add the given key-value pair to the platform field of the given VM.
- */
-extern bool
-xen_vm_add_to_platform(xen_session *session, xen_vm vm, char *key, char *value);
-
-
-/**
- * Remove the given key and its corresponding value from the platform
- * field of the given VM.  If the key is not in that Map, then do nothing.
- */
-extern bool
-xen_vm_remove_from_platform(xen_session *session, xen_vm vm, char *key);
-
-
-/**
- * Set the PCI_bus field of the given VM.
- */
-extern bool
-xen_vm_set_pci_bus(xen_session *session, xen_vm vm, char *pci_bus);
-
-
-/**
- * Set the other_config field of the given VM.
- */
-extern bool
-xen_vm_set_other_config(xen_session *session, xen_vm vm, xen_string_string_map *other_config);
-
-
-/**
- * Add the given key-value pair to the other_config field of the given
- * VM.
- */
-extern bool
-xen_vm_add_to_other_config(xen_session *session, xen_vm vm, char *key, char *value);
-
-
-/**
- * Remove the given key and its corresponding value from the
- * other_config field of the given VM.  If the key is not in that Map, then do
- * nothing.
- */
-extern bool
-xen_vm_remove_from_other_config(xen_session *session, xen_vm vm, char *key);
-
-
-/**
- * Clones the specified VM, making a new VM. Clone automatically
- * exploits the capabilities of the underlying storage repository in which the
- * VM's disk images are stored (e.g. Copy on Write).   This function can only
- * be called when the VM is in the Halted State.
- */
-extern bool
-xen_vm_clone(xen_session *session, xen_vm *result, xen_vm vm, char *new_name);
-
-
-/**
- * Start the specified VM.  This function can only be called with the
- * VM is in the Halted State.
- */
-extern bool
-xen_vm_start(xen_session *session, xen_vm vm, bool start_paused);
-
-
-/**
- * Pause the specified VM. This can only be called when the specified
- * VM is in the Running state.
- */
-extern bool
-xen_vm_pause(xen_session *session, xen_vm vm);
-
-
-/**
- * Resume the specified VM. This can only be called when the specified
- * VM is in the Paused state.
- */
-extern bool
-xen_vm_unpause(xen_session *session, xen_vm vm);
-
-
-/**
- * Attempt to cleanly shutdown the specified VM. (Note: this may not be
- * supported---e.g. if a guest agent is not installed).
- * 
- * Once shutdown has been completed perform poweroff action specified in guest
- * configuration.
- * 
- * This can only be called when the specified VM is in the Running state.
- */
-extern bool
-xen_vm_clean_shutdown(xen_session *session, xen_vm vm);
-
-
-/**
- * Attempt to cleanly shutdown the specified VM (Note: this may not be
- * supported---e.g. if a guest agent is not installed).
- * 
- * Once shutdown has been completed perform reboot action specified in guest
- * configuration.
- * 
- * This can only be called when the specified VM is in the Running state.
- */
-extern bool
-xen_vm_clean_reboot(xen_session *session, xen_vm vm);
-
-
-/**
- * Stop executing the specified VM without attempting a clean shutdown.
- * Then perform poweroff action specified in VM configuration.
- */
-extern bool
-xen_vm_hard_shutdown(xen_session *session, xen_vm vm);
-
-
-/**
- * Stop executing the specified VM without attempting a clean shutdown.
- * Then perform reboot action specified in VM configuration
- */
-extern bool
-xen_vm_hard_reboot(xen_session *session, xen_vm vm);
-
-
-/**
- * Suspend the specified VM to disk.  This can only be called when the
- * specified VM is in the Running state.
- */
-extern bool
-xen_vm_suspend(xen_session *session, xen_vm vm);
-
-
-/**
- * Awaken the specified VM and resume it.  This can only be called when
- * the specified VM is in the Suspended state.
- */
-extern bool
-xen_vm_resume(xen_session *session, xen_vm vm, bool start_paused);
-
-
-/**
- * Set this VM's VCPUs/at_startup value, and set the same value on the
- * VM, if running
- */
-extern bool
-xen_vm_set_vcpus_number_live(xen_session *session, xen_vm self, int64_t nvcpu);
-
-
-/**
- * Add the given key-value pair to VM.VCPUs_params, and apply that
- * value on the running VM.
- */
-extern bool
-xen_vm_add_to_vcpus_params_live(xen_session *session, xen_vm self, char *key, char *value);
-
-
-/**
- * Set memory_dynamic_max in database and on running VM.
- */
-extern bool
-xen_vm_set_memory_dynamic_max_live(xen_session *session, xen_vm self, int64_t max);
-
-
-/**
- * Set memory_dynamic_min in database and on running VM.
- */
-extern bool
-xen_vm_set_memory_dynamic_min_live(xen_session *session, xen_vm self, int64_t min);
-
-
-/**
- * Send the given key as a sysrq to this VM.  The key is specified as a
- * single character (a String of length 1).  This can only be called when the
- * specified VM is in the Running state.
- */
-extern bool
-xen_vm_send_sysrq(xen_session *session, xen_vm vm, char *key);
-
-
-/**
- * Send the named trigger to this VM.  This can only be called when the
- * specified VM is in the Running state.
- */
-extern bool
-xen_vm_send_trigger(xen_session *session, xen_vm vm, char *trigger);
-
-
-/**
- * Migrate the VM to another host.  This can only be called when the
- * specified VM is in the Running state.
- */
-extern bool
-xen_vm_migrate(xen_session *session, xen_vm vm, char *dest, bool live, xen_string_string_map *options);
-
-
-/**
- * Return a list of all the VMs known to the system.
- */
-extern bool
-xen_vm_get_all(xen_session *session, struct xen_vm_set **result);
-
-
-#endif
diff --git a/tools/libxen/include/xen_vm_decl.h b/tools/libxen/include/xen_vm_decl.h
deleted file mode 100644 (file)
index 815b036..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_VM_DECL_H
-#define XEN_VM_DECL_H
-
-typedef void *xen_vm;
-
-struct xen_vm_set;
-struct xen_vm_record;
-struct xen_vm_record_set;
-struct xen_vm_record_opt;
-struct xen_vm_record_opt_set;
-
-#endif
diff --git a/tools/libxen/include/xen_vm_guest_metrics.h b/tools/libxen/include/xen_vm_guest_metrics.h
deleted file mode 100644 (file)
index 2734764..0000000
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_VM_GUEST_METRICS_H
-#define XEN_VM_GUEST_METRICS_H
-
-#include "xen_common.h"
-#include "xen_string_string_map.h"
-#include "xen_vm_guest_metrics_decl.h"
-
-
-/*
- * The VM_guest_metrics class.
- * 
- * The metrics reported by the guest (as opposed to inferred from outside).
- */
-
-
-/**
- * Free the given xen_vm_guest_metrics.  The given handle must have
- * been allocated by this library.
- */
-extern void
-xen_vm_guest_metrics_free(xen_vm_guest_metrics vm_guest_metrics);
-
-
-typedef struct xen_vm_guest_metrics_set
-{
-    size_t size;
-    xen_vm_guest_metrics *contents[];
-} xen_vm_guest_metrics_set;
-
-/**
- * Allocate a xen_vm_guest_metrics_set of the given size.
- */
-extern xen_vm_guest_metrics_set *
-xen_vm_guest_metrics_set_alloc(size_t size);
-
-/**
- * Free the given xen_vm_guest_metrics_set.  The given set must have
- * been allocated by this library.
- */
-extern void
-xen_vm_guest_metrics_set_free(xen_vm_guest_metrics_set *set);
-
-
-typedef struct xen_vm_guest_metrics_record
-{
-    xen_vm_guest_metrics handle;
-    char *uuid;
-    xen_string_string_map *os_version;
-    xen_string_string_map *pv_drivers_version;
-    xen_string_string_map *memory;
-    xen_string_string_map *disks;
-    xen_string_string_map *networks;
-    xen_string_string_map *other;
-    time_t last_updated;
-} xen_vm_guest_metrics_record;
-
-/**
- * Allocate a xen_vm_guest_metrics_record.
- */
-extern xen_vm_guest_metrics_record *
-xen_vm_guest_metrics_record_alloc(void);
-
-/**
- * Free the given xen_vm_guest_metrics_record, and all referenced
- * values.  The given record must have been allocated by this library.
- */
-extern void
-xen_vm_guest_metrics_record_free(xen_vm_guest_metrics_record *record);
-
-
-typedef struct xen_vm_guest_metrics_record_opt
-{
-    bool is_record;
-    union
-    {
-        xen_vm_guest_metrics handle;
-        xen_vm_guest_metrics_record *record;
-    } u;
-} xen_vm_guest_metrics_record_opt;
-
-/**
- * Allocate a xen_vm_guest_metrics_record_opt.
- */
-extern xen_vm_guest_metrics_record_opt *
-xen_vm_guest_metrics_record_opt_alloc(void);
-
-/**
- * Free the given xen_vm_guest_metrics_record_opt, and all referenced
- * values.  The given record_opt must have been allocated by this library.
- */
-extern void
-xen_vm_guest_metrics_record_opt_free(xen_vm_guest_metrics_record_opt *record_opt);
-
-
-typedef struct xen_vm_guest_metrics_record_set
-{
-    size_t size;
-    xen_vm_guest_metrics_record *contents[];
-} xen_vm_guest_metrics_record_set;
-
-/**
- * Allocate a xen_vm_guest_metrics_record_set of the given size.
- */
-extern xen_vm_guest_metrics_record_set *
-xen_vm_guest_metrics_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_vm_guest_metrics_record_set, and all referenced
- * values.  The given set must have been allocated by this library.
- */
-extern void
-xen_vm_guest_metrics_record_set_free(xen_vm_guest_metrics_record_set *set);
-
-
-
-typedef struct xen_vm_guest_metrics_record_opt_set
-{
-    size_t size;
-    xen_vm_guest_metrics_record_opt *contents[];
-} xen_vm_guest_metrics_record_opt_set;
-
-/**
- * Allocate a xen_vm_guest_metrics_record_opt_set of the given size.
- */
-extern xen_vm_guest_metrics_record_opt_set *
-xen_vm_guest_metrics_record_opt_set_alloc(size_t size);
-
-/**
- * Free the given xen_vm_guest_metrics_record_opt_set, and all
- * referenced values.  The given set must have been allocated by this library.
- */
-extern void
-xen_vm_guest_metrics_record_opt_set_free(xen_vm_guest_metrics_record_opt_set *set);
-
-
-/**
- * Get a record containing the current state of the given
- * VM_guest_metrics.
- */
-extern bool
-xen_vm_guest_metrics_get_record(xen_session *session, xen_vm_guest_metrics_record **result, xen_vm_guest_metrics vm_guest_metrics);
-
-
-/**
- * Get a reference to the VM_guest_metrics instance with the specified
- * UUID.
- */
-extern bool
-xen_vm_guest_metrics_get_by_uuid(xen_session *session, xen_vm_guest_metrics *result, char *uuid);
-
-
-/**
- * Get the uuid field of the given VM_guest_metrics.
- */
-extern bool
-xen_vm_guest_metrics_get_uuid(xen_session *session, char **result, xen_vm_guest_metrics vm_guest_metrics);
-
-
-/**
- * Get the os_version field of the given VM_guest_metrics.
- */
-extern bool
-xen_vm_guest_metrics_get_os_version(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
-
-
-/**
- * Get the PV_drivers_version field of the given VM_guest_metrics.
- */
-extern bool
-xen_vm_guest_metrics_get_pv_drivers_version(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
-
-
-/**
- * Get the memory field of the given VM_guest_metrics.
- */
-extern bool
-xen_vm_guest_metrics_get_memory(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
-
-
-/**
- * Get the disks field of the given VM_guest_metrics.
- */
-extern bool
-xen_vm_guest_metrics_get_disks(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
-
-
-/**
- * Get the networks field of the given VM_guest_metrics.
- */
-extern bool
-xen_vm_guest_metrics_get_networks(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
-
-
-/**
- * Get the other field of the given VM_guest_metrics.
- */
-extern bool
-xen_vm_guest_metrics_get_other(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
-
-
-/**
- * Get the last_updated field of the given VM_guest_metrics.
- */
-extern bool
-xen_vm_guest_metrics_get_last_updated(xen_session *session, time_t *result, xen_vm_guest_metrics vm_guest_metrics);
-
-
-/**
- * Return a list of all the VM_guest_metrics instances known to the
- * system.
- */
-extern bool
-xen_vm_guest_metrics_get_all(xen_session *session, struct xen_vm_guest_metrics_set **result);
-
-
-#endif
diff --git a/tools/libxen/include/xen_vm_guest_metrics_decl.h b/tools/libxen/include/xen_vm_guest_metrics_decl.h
deleted file mode 100644 (file)
index 837528b..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_VM_GUEST_METRICS_DECL_H
-#define XEN_VM_GUEST_METRICS_DECL_H
-
-typedef void *xen_vm_guest_metrics;
-
-struct xen_vm_guest_metrics_set;
-struct xen_vm_guest_metrics_record;
-struct xen_vm_guest_metrics_record_set;
-struct xen_vm_guest_metrics_record_opt;
-struct xen_vm_guest_metrics_record_opt_set;
-
-#endif
diff --git a/tools/libxen/include/xen_vm_metrics.h b/tools/libxen/include/xen_vm_metrics.h
deleted file mode 100644 (file)
index 3350a66..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Copyright (c) 2006-2007, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_VM_METRICS_H
-#define XEN_VM_METRICS_H
-
-#include "xen_common.h"
-#include "xen_int_float_map.h"
-#include "xen_int_int_map.h"
-#include "xen_int_string_set_map.h"
-#include "xen_string_set.h"
-#include "xen_string_string_map.h"
-#include "xen_vm_metrics_decl.h"
-
-
-/*
- * The VM_metrics class.
- * 
- * The metrics associated with a VM.
- */
-
-
-/**
- * Free the given xen_vm_metrics.  The given handle must have been
- * allocated by this library.
- */
-extern void
-xen_vm_metrics_free(xen_vm_metrics vm_metrics);
-
-
-typedef struct xen_vm_metrics_set
-{
-    size_t size;
-    xen_vm_metrics *contents[];
-} xen_vm_metrics_set;
-
-/**
- * Allocate a xen_vm_metrics_set of the given size.
- */
-extern xen_vm_metrics_set *
-xen_vm_metrics_set_alloc(size_t size);
-
-/**
- * Free the given xen_vm_metrics_set.  The given set must have been
- * allocated by this library.
- */
-extern void
-xen_vm_metrics_set_free(xen_vm_metrics_set *set);
-
-
-typedef struct xen_vm_metrics_record
-{
-    xen_vm_metrics handle;
-    char *uuid;
-    int64_t memory_actual;
-    int64_t vcpus_number;
-    xen_int_float_map *vcpus_utilisation;
-    xen_int_int_map *vcpus_cpu;
-    xen_string_string_map *vcpus_params;
-    xen_int_string_set_map *vcpus_flags;
-    struct xen_string_set *state;
-    time_t start_time;
-    time_t last_updated;
-} xen_vm_metrics_record;
-
-/**
- * Allocate a xen_vm_metrics_record.
- */
-extern xen_vm_metrics_record *
-xen_vm_metrics_record_alloc(void);
-
-/**
- * Free the given xen_vm_metrics_record, and all referenced values. 
- * The given record must have been allocated by this library.
- */
-extern void
-xen_vm_metrics_record_free(xen_vm_metrics_record *record);
-
-
-typedef struct xen_vm_metrics_record_opt
-{
-    bool is_record;
-    union
-    {
-        xen_vm_metrics handle;
-        xen_vm_metrics_record *record;
-    } u;
-} xen_vm_metrics_record_opt;
-
-/**
- * Allocate a xen_vm_metrics_record_opt.
- */
-extern xen_vm_metrics_record_opt *
-xen_vm_metrics_record_opt_alloc(void);
-
-/**
- * Free the given xen_vm_metrics_record_opt, and all referenced values.
- *  The given record_opt must have been allocated by this library.
- */
-extern void
-xen_vm_metrics_record_opt_free(xen_vm_metrics_record_opt *record_opt);
-
-
-typedef struct xen_vm_metrics_record_set
-{
-    size_t size;
-    xen_vm_metrics_record *contents[];
-} xen_vm_metrics_record_set;
-
-/**
- * Allocate a xen_vm_metrics_record_set of the given size.
- */
-extern xen_vm_metrics_record_set *
-xen_vm_metrics_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_vm_metrics_record_set, and all referenced values.
- *  The given set must have been allocated by this library.
- */
-extern void
-xen_vm_metrics_record_set_free(xen_vm_metrics_record_set *set);
-
-
-
-typedef struct xen_vm_metrics_record_opt_set
-{
-    size_t size;
-    xen_vm_metrics_record_opt *contents[];
-} xen_vm_metrics_record_opt_set;
-
-/**
- * Allocate a xen_vm_metrics_record_opt_set of the given size.
- */
-extern xen_vm_metrics_record_opt_set *
-xen_vm_metrics_record_opt_set_alloc(size_t size);
-
-/**
- * Free the given xen_vm_metrics_record_opt_set, and all referenced
- * values.  The given set must have been allocated by this library.
- */
-extern void
-xen_vm_metrics_record_opt_set_free(xen_vm_metrics_record_opt_set *set);
-
-
-/**
- * Get a record containing the current state of the given VM_metrics.
- */
-extern bool
-xen_vm_metrics_get_record(xen_session *session, xen_vm_metrics_record **result, xen_vm_metrics vm_metrics);
-
-
-/**
- * Get a reference to the VM_metrics instance with the specified UUID.
- */
-extern bool
-xen_vm_metrics_get_by_uuid(xen_session *session, xen_vm_metrics *result, char *uuid);
-
-
-/**
- * Get the uuid field of the given VM_metrics.
- */
-extern bool
-xen_vm_metrics_get_uuid(xen_session *session, char **result, xen_vm_metrics vm_metrics);
-
-
-/**
- * Get the memory/actual field of the given VM_metrics.
- */
-extern bool
-xen_vm_metrics_get_memory_actual(xen_session *session, int64_t *result, xen_vm_metrics vm_metrics);
-
-
-/**
- * Get the VCPUs/number field of the given VM_metrics.
- */
-extern bool
-xen_vm_metrics_get_vcpus_number(xen_session *session, int64_t *result, xen_vm_metrics vm_metrics);
-
-
-/**
- * Get the VCPUs/utilisation field of the given VM_metrics.
- */
-extern bool
-xen_vm_metrics_get_vcpus_utilisation(xen_session *session, xen_int_float_map **result, xen_vm_metrics vm_metrics);
-
-
-/**
- * Get the VCPUs/CPU field of the given VM_metrics.
- */
-extern bool
-xen_vm_metrics_get_vcpus_cpu(xen_session *session, xen_int_int_map **result, xen_vm_metrics vm_metrics);
-
-
-/**
- * Get the VCPUs/params field of the given VM_metrics.
- */
-extern bool
-xen_vm_metrics_get_vcpus_params(xen_session *session, xen_string_string_map **result, xen_vm_metrics vm_metrics);
-
-
-/**
- * Get the VCPUs/flags field of the given VM_metrics.
- */
-extern bool
-xen_vm_metrics_get_vcpus_flags(xen_session *session, xen_int_string_set_map **result, xen_vm_metrics vm_metrics);
-
-
-/**
- * Get the state field of the given VM_metrics.
- */
-extern bool
-xen_vm_metrics_get_state(xen_session *session, struct xen_string_set **result, xen_vm_metrics vm_metrics);
-
-
-/**
- * Get the start_time field of the given VM_metrics.
- */
-extern bool
-xen_vm_metrics_get_start_time(xen_session *session, time_t *result, xen_vm_metrics vm_metrics);
-
-
-/**
- * Get the last_updated field of the given VM_metrics.
- */
-extern bool
-xen_vm_metrics_get_last_updated(xen_session *session, time_t *result, xen_vm_metrics vm_metrics);
-
-
-/**
- * Return a list of all the VM_metrics instances known to the system.
- */
-extern bool
-xen_vm_metrics_get_all(xen_session *session, struct xen_vm_metrics_set **result);
-
-
-#endif
diff --git a/tools/libxen/include/xen_vm_metrics_decl.h b/tools/libxen/include/xen_vm_metrics_decl.h
deleted file mode 100644 (file)
index ea1bcb5..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_VM_METRICS_DECL_H
-#define XEN_VM_METRICS_DECL_H
-
-typedef void *xen_vm_metrics;
-
-struct xen_vm_metrics_set;
-struct xen_vm_metrics_record;
-struct xen_vm_metrics_record_set;
-struct xen_vm_metrics_record_opt;
-struct xen_vm_metrics_record_opt_set;
-
-#endif
diff --git a/tools/libxen/include/xen_vm_power_state.h b/tools/libxen/include/xen_vm_power_state.h
deleted file mode 100644 (file)
index c5404b8..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_VM_POWER_STATE_H
-#define XEN_VM_POWER_STATE_H
-
-
-#include "xen_common.h"
-
-
-enum xen_vm_power_state
-{
-    /**
-     * Halted
-     */
-    XEN_VM_POWER_STATE_HALTED,
-
-    /**
-     * Paused
-     */
-    XEN_VM_POWER_STATE_PAUSED,
-
-    /**
-     * Running
-     */
-    XEN_VM_POWER_STATE_RUNNING,
-
-    /**
-     * Suspended
-     */
-    XEN_VM_POWER_STATE_SUSPENDED,
-
-    /**
-     * Some other unknown state
-     */
-    XEN_VM_POWER_STATE_UNKNOWN
-};
-
-
-typedef struct xen_vm_power_state_set
-{
-    size_t size;
-    enum xen_vm_power_state contents[];
-} xen_vm_power_state_set;
-
-/**
- * Allocate a xen_vm_power_state_set of the given size.
- */
-extern xen_vm_power_state_set *
-xen_vm_power_state_set_alloc(size_t size);
-
-/**
- * Free the given xen_vm_power_state_set.  The given set must have been
- * allocated by this library.
- */
-extern void
-xen_vm_power_state_set_free(xen_vm_power_state_set *set);
-
-
-/**
- * Return the name corresponding to the given code.  This string must
- * not be modified or freed.
- */
-extern const char *
-xen_vm_power_state_to_string(enum xen_vm_power_state val);
-
-
-/**
- * Return the correct code for the given string, or set the session
- * object to failure and return an undefined value if the given string does
- * not match a known code.
- */
-extern enum xen_vm_power_state
-xen_vm_power_state_from_string(xen_session *session, const char *str);
-
-
-#endif
index 2c88856c08e26f6cd905dd0bda99e69fc7745e97..a3f5af114ca43ad892bf5bf26dfde07416e6ad1a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, XenSource Inc.
+ * Copyright (c) 2006-2007, XenSource Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
diff --git a/tools/libxen/include/xen_vtpm.h b/tools/libxen/include/xen_vtpm.h
deleted file mode 100644 (file)
index add5042..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- * Copyright (c) 2006, IBM Corp.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_VTPM_H
-#define XEN_VTPM_H
-
-#include "xen_common.h"
-#include "xen_vm_decl.h"
-#include "xen_vtpm_decl.h"
-
-
-/*
- * The VTPM class. 
- *  
- * A virtual TPM device.
- */
-
-
-/**
- * Free the given xen_vtpm.  The given handle must have been allocated
- * by this library.
- */
-extern void
-xen_vtpm_free(xen_vtpm vtpm);
-
-
-typedef struct xen_vtpm_set
-{
-    size_t size;
-    xen_vtpm *contents[];
-} xen_vtpm_set;
-
-/**
- * Allocate a xen_vtpm_set of the given size.
- */
-extern xen_vtpm_set *
-xen_vtpm_set_alloc(size_t size);
-
-/**
- * Free the given xen_vtpm_set.  The given set must have been allocated
- * by this library.
- */
-extern void
-xen_vtpm_set_free(xen_vtpm_set *set);
-
-
-typedef struct xen_vtpm_record
-{
-    xen_vtpm handle;
-    char *uuid;
-    struct xen_vm_record_opt *vm;
-    struct xen_vm_record_opt *backend;
-} xen_vtpm_record;
-
-/**
- * Allocate a xen_vtpm_record.
- */
-extern xen_vtpm_record *
-xen_vtpm_record_alloc(void);
-
-/**
- * Free the given xen_vtpm_record, and all referenced values.  The
- * given record must have been allocated by this library.
- */
-extern void
-xen_vtpm_record_free(xen_vtpm_record *record);
-
-
-typedef struct xen_vtpm_record_opt
-{
-    bool is_record;
-    union
-    {
-        xen_vtpm handle;
-        xen_vtpm_record *record;
-    } u;
-} xen_vtpm_record_opt;
-
-/**
- * Allocate a xen_vtpm_record_opt.
- */
-extern xen_vtpm_record_opt *
-xen_vtpm_record_opt_alloc(void);
-
-/**
- * Free the given xen_vtpm_record_opt, and all referenced values.  The
- * given record_opt must have been allocated by this library.
- */
-extern void
-xen_vtpm_record_opt_free(xen_vtpm_record_opt *record_opt);
-
-
-typedef struct xen_vtpm_record_set
-{
-    size_t size;
-    xen_vtpm_record *contents[];
-} xen_vtpm_record_set;
-
-/**
- * Allocate a xen_vtpm_record_set of the given size.
- */
-extern xen_vtpm_record_set *
-xen_vtpm_record_set_alloc(size_t size);
-
-/**
- * Free the given xen_vtpm_record_set, and all referenced values.  The
- * given set must have been allocated by this library.
- */
-extern void
-xen_vtpm_record_set_free(xen_vtpm_record_set *set);
-
-
-
-typedef struct xen_vtpm_record_opt_set
-{
-    size_t size;
-    xen_vtpm_record_opt *contents[];
-} xen_vtpm_record_opt_set;
-
-/**
- * Allocate a xen_vtpm_record_opt_set of the given size.
- */
-extern xen_vtpm_record_opt_set *
-xen_vtpm_record_opt_set_alloc(size_t size);
-
-/**
- * Free the given xen_vtpm_record_opt_set, and all referenced values. 
- * The given set must have been allocated by this library.
- */
-extern void
-xen_vtpm_record_opt_set_free(xen_vtpm_record_opt_set *set);
-
-
-/**
- * Get a record containing the current state of the given VTPM.
- */
-extern bool
-xen_vtpm_get_record(xen_session *session, xen_vtpm_record **result, xen_vtpm vtpm);
-
-
-/**
- * Get a reference to the VTPM instance with the specified UUID.
- */
-extern bool
-xen_vtpm_get_by_uuid(xen_session *session, xen_vtpm *result, char *uuid);
-
-
-/**
- * Create a new VTPM instance, and return its handle.
- */
-extern bool
-xen_vtpm_create(xen_session *session, xen_vtpm *result, xen_vtpm_record *record);
-
-
-/**
- * Destroy the specified VTPM instance.
- */
-extern bool
-xen_vtpm_destroy(xen_session *session, xen_vtpm vtpm);
-
-
-/**
- * Get the uuid field of the given VTPM.
- */
-extern bool
-xen_vtpm_get_uuid(xen_session *session, char **result, xen_vtpm vtpm);
-
-
-/**
- * Get the VM field of the given VTPM.
- */
-extern bool
-xen_vtpm_get_vm(xen_session *session, xen_vm *result, xen_vtpm vtpm);
-
-
-/**
- * Get the backend field of the given VTPM.
- */
-extern bool
-xen_vtpm_get_backend(xen_session *session, xen_vm *result, xen_vtpm vtpm);
-
-#endif
diff --git a/tools/libxen/include/xen_vtpm_decl.h b/tools/libxen/include/xen_vtpm_decl.h
deleted file mode 100644 (file)
index 7798e38..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2006, XenSource Inc.
- * Copyright (c) 2006, IBM Corp.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#ifndef XEN_VTPM_DECL_H
-#define XEN_VTPM_DECL_H
-
-typedef void *xen_vtpm;
-
-struct xen_vtpm_set;
-struct xen_vtpm_record;
-struct xen_vtpm_record_set;
-struct xen_vtpm_record_opt;
-struct xen_vtpm_record_opt_set;
-
-#endif
index f0fc4cce3310ba3fc3d687a7ad133ca8edb9c9c6..1819381640510a5a80b51ba070c2344003ff9b0f 100644 (file)
 #include <libxml/xmlstring.h>
 #include <libxml/xpath.h>
 
-#include "xen_common.h"
-#include "xen_host.h"
+#include "xen/api/xen_common.h"
+#include "xen/api/xen_host.h"
 #include "xen_internal.h"
-#include "xen_int_float_map.h"
-#include "xen_int_int_map.h"
-#include "xen_int_string_set_map.h"
-#include "xen_string_string_map.h"
+#include "xen/api/xen_int_float_map.h"
+#include "xen/api/xen_int_int_map.h"
+#include "xen/api/xen_int_string_set_map.h"
+#include "xen/api/xen_string_string_map.h"
 
 
 /*
index 9d0764a2d662337eacea6fbb1b45a3d6f392bed3..2b45498295c92fb487f007267e761b86aeaa40e6 100644 (file)
 #include <stddef.h>
 #include <stdlib.h>
 
-#include "xen_common.h"
-#include "xen_console.h"
 #include "xen_console_protocol_internal.h"
 #include "xen_internal.h"
-#include "xen_string_string_map.h"
-#include "xen_vm.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_console.h>
+#include <xen/api/xen_string_string_map.h>
+#include <xen/api/xen_vm.h>
 
 
 XEN_FREE(xen_console)
index cb87ac01c959e58a39773a405b2f3690b0604fb3..031d64d9a525894fc958bc94fa98c6353a315dca 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, XenSource Inc.
+ * Copyright (c) 2006-2007, XenSource Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -19,7 +19,7 @@
 #include <string.h>
 
 #include "xen_internal.h"
-#include "xen_console_protocol.h"
+#include <xen/api/xen_console_protocol.h>
 #include "xen_console_protocol_internal.h"
 
 
index 5d8f70a2ea2a5380bebf67ad8a68e62a8813238d..ba2121bcde8b8fc0f7c6fa5696008d76755c7f97 100644 (file)
 #include <stddef.h>
 #include <stdlib.h>
 
-#include "xen_common.h"
-#include "xen_crashdump.h"
 #include "xen_internal.h"
-#include "xen_vdi.h"
-#include "xen_vm.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_crashdump.h>
+#include <xen/api/xen_vdi.h>
+#include <xen/api/xen_vm.h>
 
 
 XEN_FREE(xen_crashdump)
index 3022caffed26286b3f07cba520b5e97a3d77d0ca..30e8d60820e57df6fd585dcfec07a45e12a9474d 100644 (file)
 #include <stddef.h>
 #include <stdlib.h>
 
-#include "xen_common.h"
-#include "xen_event.h"
 #include "xen_event_operation_internal.h"
 #include "xen_internal.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_event.h>
 
 
 XEN_ALLOC(xen_event_record)
index c338af0930dde2c7530cbbcf313d3ae7fcc08b0d..48a7c362ac4543c5f8050d589155c2e7b72e1193 100644 (file)
@@ -19,7 +19,7 @@
 #include <string.h>
 
 #include "xen_internal.h"
-#include "xen_event_operation.h"
+#include <xen/api/xen_event_operation.h>
 #include "xen_event_operation_internal.h"
 
 
index 331ed2105b752263d7f1e424ee3a6d15a37ff7b2..0739c4fe4e326478d634818ca4b66769debc87ad 100644 (file)
 #include <stddef.h>
 #include <stdlib.h>
 
-#include "xen_common.h"
-#include "xen_host.h"
-#include "xen_host_cpu.h"
-#include "xen_host_metrics.h"
 #include "xen_internal.h"
-#include "xen_pbd.h"
-#include "xen_pif.h"
-#include "xen_sr.h"
-#include "xen_string_string_map.h"
-#include "xen_vm.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_host.h>
+#include <xen/api/xen_host_cpu.h>
+#include <xen/api/xen_host_metrics.h>
+#include <xen/api/xen_pbd.h>
+#include <xen/api/xen_pif.h>
+#include <xen/api/xen_sr.h>
+#include <xen/api/xen_string_string_map.h>
+#include <xen/api/xen_vm.h>
 
 
 XEN_FREE(xen_host)
index 9509c570e428805f0d82753b2203907a41bc5f8d..6e84b49f63a349b5be2a996bc430155190ac6a12 100644 (file)
 #include <stddef.h>
 #include <stdlib.h>
 
-#include "xen_common.h"
-#include "xen_host.h"
-#include "xen_host_cpu.h"
 #include "xen_internal.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_host.h>
+#include <xen/api/xen_host_cpu.h>
 
 
 XEN_FREE(xen_host_cpu)
index 203f25ed0a4f3d5e59c593093b53e97edf50fcea..976f4c5e40d40b28ad19be1998ceefa12fa704f2 100644 (file)
@@ -20,9 +20,9 @@
 #include <stddef.h>
 #include <stdlib.h>
 
-#include "xen_common.h"
-#include "xen_host_metrics.h"
 #include "xen_internal.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_host_metrics.h>
 
 
 XEN_FREE(xen_host_metrics)
index 33ff29de6258bc88ffaaf5765ee1195262162305..ed3bf48243f8aa643257107858193d0d682d1bda 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, XenSource Inc.
+ * Copyright (c) 2006-2007, XenSource Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -17,9 +17,9 @@
  */
 
 
-#include "xen_common.h"
-#include "xen_int_float_map.h"
 #include "xen_internal.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_int_float_map.h>
 
 
 xen_int_float_map *
index b7eeba6e9658045202a7c3e103bcb983beeb242a..3d87c22885e12a5b826170bb91a787cf9645b862 100644 (file)
@@ -17,9 +17,9 @@
  */
 
 
-#include "xen_common.h"
-#include "xen_int_int_map.h"
 #include "xen_internal.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_int_int_map.h>
 
 
 xen_int_int_map *
index 1b3792703494749ecf52b5419f30ace4f55d2899..ba61c8126852f8ae4eaff4dcefabf5064f171fee 100644 (file)
  */
 
 
-#include "xen_common.h"
-#include "xen_int_string_set_map.h"
 #include "xen_internal.h"
-#include "xen_string_set.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_int_string_set_map.h>
+#include <xen/api/xen_string_set.h>
 
 
 xen_int_string_set_map *
index 01393f6773366255b67d4e147110237523ccb480..4b03ead0e40a278767213a18e71c34dfe1702fdc 100644 (file)
 #include <stddef.h>
 #include <stdlib.h>
 
-#include "xen_common.h"
 #include "xen_internal.h"
-#include "xen_network.h"
-#include "xen_pif.h"
-#include "xen_string_string_map.h"
-#include "xen_vif.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_network.h>
+#include <xen/api/xen_pif.h>
+#include <xen/api/xen_string_string_map.h>
+#include <xen/api/xen_vif.h>
 
 
 XEN_FREE(xen_network)
index cb1d0deca91db281cedc57cc3437569cd24c5677..abd25db47e3dc75ec0d4dfa6c538ecb15a7eade3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, XenSource Inc.
+ * Copyright (c) 2006-2007, XenSource Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -19,7 +19,7 @@
 #include <string.h>
 
 #include "xen_internal.h"
-#include "xen_on_crash_behaviour.h"
+#include <xen/api/xen_on_crash_behaviour.h>
 #include "xen_on_crash_behaviour_internal.h"
 
 
index 3cfe09766bd01b61bde78c4b856c46d4d193ff24..bbb4e276dc570740e5f1187be58295394b3bec7b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, XenSource Inc.
+ * Copyright (c) 2006-2007, XenSource Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -19,7 +19,7 @@
 #include <string.h>
 
 #include "xen_internal.h"
-#include "xen_on_normal_exit.h"
+#include <xen/api/xen_on_normal_exit.h>
 #include "xen_on_normal_exit_internal.h"
 
 
index 2b8bbd5b44b89f2a34defd753f7369c539fc8795..d3702ef4e24aa18fb98e3f7f3b9fe234aefef55b 100644 (file)
 #include <stddef.h>
 #include <stdlib.h>
 
-#include "xen_common.h"
-#include "xen_host.h"
 #include "xen_internal.h"
-#include "xen_pbd.h"
-#include "xen_sr.h"
-#include "xen_string_string_map.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_host.h>
+#include <xen/api/xen_pbd.h>
+#include <xen/api/xen_sr.h>
+#include <xen/api/xen_string_string_map.h>
 
 
 XEN_FREE(xen_pbd)
index 9dfaec7b519bae6cb30ddbd705e0d218198475bc..7cf9a744abdfd356f18e69ae4ab67ae22bf347a5 100644 (file)
 #include <stddef.h>
 #include <stdlib.h>
 
-#include "xen_common.h"
-#include "xen_host.h"
 #include "xen_internal.h"
-#include "xen_network.h"
-#include "xen_pif.h"
-#include "xen_pif_metrics.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_host.h>
+#include <xen/api/xen_network.h>
+#include <xen/api/xen_pif.h>
+#include <xen/api/xen_pif_metrics.h>
 
 
 XEN_FREE(xen_pif)
index c1413442cad1dda0a085fd29b1304fb44a9c0215..f150f7f5e9e2195c266b3a493429bebf53f95a13 100644 (file)
@@ -20,9 +20,9 @@
 #include <stddef.h>
 #include <stdlib.h>
 
-#include "xen_common.h"
 #include "xen_internal.h"
-#include "xen_pif_metrics.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_pif_metrics.h>
 
 
 XEN_FREE(xen_pif_metrics)
index 5220fa3019eb2dfb6ed1463ce3cb738c70caff53..b2ff310f7e5c7312dbbba4ea9c28644644952d21 100644 (file)
 #include <stddef.h>
 #include <stdlib.h>
 
-#include "xen_common.h"
 #include "xen_internal.h"
-#include "xen_pbd.h"
-#include "xen_sr.h"
-#include "xen_vdi.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_pbd.h>
+#include <xen/api/xen_sr.h>
+#include <xen/api/xen_vdi.h>
 
 
 XEN_FREE(xen_sr)
index 882943356c8130be323d8c208c539665a37d350b..7af0f882a6be69d1c152d040a13c8837691c4220 100644 (file)
@@ -18,7 +18,7 @@
 
 
 #include "xen_internal.h"
-#include "xen_string_set.h"
+#include <xen/api/xen_string_set.h>
 
 
 xen_string_set *
index b07acfbf7c6067e799db1f5a155474d633df06f1..84ae0fcd19767e1d3a8c062fcd9c814cc8c8fffa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, XenSource Inc.
+ * Copyright (c) 2006-2007, XenSource Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -17,9 +17,9 @@
  */
 
 
-#include "xen_common.h"
 #include "xen_internal.h"
-#include "xen_string_string_map.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_string_string_map.h>
 
 
 xen_string_string_map *
index b4dde9d74e2129b3b6d6d33796f26036a50d76d5..377f8f89ca61d4fcfd965f9390704ffd0cf63f6a 100644 (file)
@@ -20,9 +20,9 @@
 #include <stddef.h>
 #include <stdlib.h>
 
-#include "xen_common.h"
 #include "xen_internal.h"
-#include "xen_user.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_user.h>
 
 
 XEN_FREE(xen_user)
index facedad94f66e793abcc54207113e06680e0a280..85b034b45aab1c7fb0a25b73fc685ddb528d6168 100644 (file)
 #include <stddef.h>
 #include <stdlib.h>
 
-#include "xen_common.h"
 #include "xen_internal.h"
-#include "xen_string_string_map.h"
-#include "xen_vbd.h"
-#include "xen_vbd_metrics.h"
 #include "xen_vbd_mode_internal.h"
 #include "xen_vbd_type_internal.h"
-#include "xen_vdi.h"
-#include "xen_vm.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_string_string_map.h>
+#include <xen/api/xen_vbd.h>
+#include <xen/api/xen_vbd_metrics.h>
+#include <xen/api/xen_vdi.h>
+#include <xen/api/xen_vm.h>
 
 
 XEN_FREE(xen_vbd)
index fb5395d3096f0f02c7c199f38695bc42c2c638b8..c4f336c82e50135c80b99b8d16f2cf0451d8cc5f 100644 (file)
@@ -20,9 +20,9 @@
 #include <stddef.h>
 #include <stdlib.h>
 
-#include "xen_common.h"
 #include "xen_internal.h"
-#include "xen_vbd_metrics.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_vbd_metrics.h>
 
 
 XEN_FREE(xen_vbd_metrics)
index e9fa71140aa64a5f8480aa291483c9e3caccb481..71abc42465a5d62414f2834be1daef7adb7881da 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, XenSource Inc.
+ * Copyright (c) 2006-2007, XenSource Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -19,7 +19,7 @@
 #include <string.h>
 
 #include "xen_internal.h"
-#include "xen_vbd_mode.h"
+#include <xen/api/xen_vbd_mode.h>
 #include "xen_vbd_mode_internal.h"
 
 
index 874eb096ef630c786aa3a964eead96d3996c1be6..0572635ffb8a709c23adce7320ac0052d048f24c 100644 (file)
@@ -19,7 +19,7 @@
 #include <string.h>
 
 #include "xen_internal.h"
-#include "xen_vbd_type.h"
+#include <xen/api/xen_vbd_type.h>
 #include "xen_vbd_type_internal.h"
 
 
index 66a524c9c3e4e4c7de0ba1c16e2f5dd14324337c..9c161a4c8df7675f53d7b1d83993ab2a9e4cf8f1 100644 (file)
 #include <stddef.h>
 #include <stdlib.h>
 
-#include "xen_common.h"
-#include "xen_crashdump.h"
 #include "xen_internal.h"
-#include "xen_sr.h"
-#include "xen_string_string_map.h"
-#include "xen_vbd.h"
-#include "xen_vdi.h"
 #include "xen_vdi_type_internal.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_crashdump.h>
+#include <xen/api/xen_sr.h>
+#include <xen/api/xen_string_string_map.h>
+#include <xen/api/xen_vbd.h>
+#include <xen/api/xen_vdi.h>
 
 
 XEN_FREE(xen_vdi)
index 79e855fa5920b1fa4b81630310939e61e18f3de9..4f0bda7b3a1188cdd9eca68f0399cb79a1efa9d2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, XenSource Inc.
+ * Copyright (c) 2006-2007, XenSource Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -19,7 +19,7 @@
 #include <string.h>
 
 #include "xen_internal.h"
-#include "xen_vdi_type.h"
+#include <xen/api/xen_vdi_type.h>
 #include "xen_vdi_type_internal.h"
 
 
index b0ea376a4b0867e6598fabf84325033ebe74da54..bc9dd0dd2fe64bfe44d34868cc02157f44436c97 100644 (file)
 #include <stddef.h>
 #include <stdlib.h>
 
-#include "xen_common.h"
 #include "xen_internal.h"
-#include "xen_network.h"
-#include "xen_string_string_map.h"
-#include "xen_vif.h"
-#include "xen_vif_metrics.h"
-#include "xen_vm.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_network.h>
+#include <xen/api/xen_string_string_map.h>
+#include <xen/api/xen_vif.h>
+#include <xen/api/xen_vif_metrics.h>
+#include <xen/api/xen_vm.h>
 
 
 XEN_FREE(xen_vif)
index 7c101f89337509dd4768aff152fb6d1ac366f876..9b876e52f8ce6336e6fd772363f25f59855379a4 100644 (file)
@@ -20,9 +20,9 @@
 #include <stddef.h>
 #include <stdlib.h>
 
-#include "xen_common.h"
 #include "xen_internal.h"
-#include "xen_vif_metrics.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_vif_metrics.h>
 
 
 XEN_FREE(xen_vif_metrics)
index d2a4309a0da1a9db89e1e64e10e62871b24e460c..495103c9a9170e88c773e7f84d6ea3963117f051 100644 (file)
 #include <stddef.h>
 #include <stdlib.h>
 
-#include "xen_common.h"
-#include "xen_console.h"
-#include "xen_crashdump.h"
-#include "xen_host.h"
 #include "xen_internal.h"
 #include "xen_on_crash_behaviour_internal.h"
 #include "xen_on_normal_exit_internal.h"
-#include "xen_string_string_map.h"
-#include "xen_vbd.h"
-#include "xen_vdi.h"
-#include "xen_vif.h"
-#include "xen_vm.h"
-#include "xen_vm_guest_metrics.h"
-#include "xen_vm_metrics.h"
 #include "xen_vm_power_state_internal.h"
-#include "xen_vtpm.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_console.h>
+#include <xen/api/xen_crashdump.h>
+#include <xen/api/xen_host.h>
+#include <xen/api/xen_string_string_map.h>
+#include <xen/api/xen_vbd.h>
+#include <xen/api/xen_vdi.h>
+#include <xen/api/xen_vif.h>
+#include <xen/api/xen_vm.h>
+#include <xen/api/xen_vm_guest_metrics.h>
+#include <xen/api/xen_vm_metrics.h>
+#include <xen/api/xen_vtpm.h>
 
 
 XEN_FREE(xen_vm)
index 0e60926babdcc9ff50cd9d95a49d010ef8eb77d4..251b65e1b50e082b942f60432654f85679a321f9 100644 (file)
 #include <stddef.h>
 #include <stdlib.h>
 
-#include "xen_common.h"
 #include "xen_internal.h"
-#include "xen_string_string_map.h"
-#include "xen_vm_guest_metrics.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_string_string_map.h>
+#include <xen/api/xen_vm_guest_metrics.h>
 
 
 XEN_FREE(xen_vm_guest_metrics)
index 267393a9354bfd5190b84a3b70e0a742df0f8774..7f2ab944418d59bbdf54b9741117af72f45f5d7b 100644 (file)
 #include <stddef.h>
 #include <stdlib.h>
 
-#include "xen_common.h"
-#include "xen_int_float_map.h"
-#include "xen_int_int_map.h"
-#include "xen_int_string_set_map.h"
 #include "xen_internal.h"
-#include "xen_string_string_map.h"
-#include "xen_vm_metrics.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_int_float_map.h>
+#include <xen/api/xen_int_int_map.h>
+#include <xen/api/xen_int_string_set_map.h>
+#include <xen/api/xen_string_string_map.h>
+#include <xen/api/xen_vm_metrics.h>
 
 
 XEN_FREE(xen_vm_metrics)
index 9f96f34f9b66810648c9f0b0edf9e6ca8b0385a9..9797e6316329b25feb483978fbe5c781012bffb6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, XenSource Inc.
+ * Copyright (c) 2006-2007, XenSource Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -19,7 +19,7 @@
 #include <string.h>
 
 #include "xen_internal.h"
-#include "xen_vm_power_state.h"
+#include <xen/api/xen_vm_power_state.h>
 #include "xen_vm_power_state_internal.h"
 
 
index 28d849ae1cffa73c7fd863a18fa62b67e6f8a0e4..5ed369223442555274a260651e8ab85076f9d607 100644 (file)
 #include <stddef.h>
 #include <stdlib.h>
 
-#include "xen_common.h"
 #include "xen_internal.h"
-#include "xen_vm.h"
-#include "xen_vtpm.h"
+#include <xen/api/xen_common.h>
+#include <xen/api/xen_vm.h>
+#include <xen/api/xen_vtpm.h>
 
 
 XEN_FREE(xen_vtpm)
@@ -46,7 +46,7 @@ static const struct_member xen_vtpm_record_struct_members[] =
           .offset = offsetof(xen_vtpm_record, vm) },
         { .key = "backend",
           .type = &abstract_type_ref,
-          .offset = offsetof(xen_vtpm_record, backend) },
+          .offset = offsetof(xen_vtpm_record, backend) }
     };
 
 const abstract_type xen_vtpm_record_abstract_type_ =
index 0659cd89e1184f2c4a3ca750398e6c402e3bed70..566a0388fa01bf89e0078481d99ebc86ade3d60f 100644 (file)
 
 #include <libxml/parser.h>
 #include <curl/curl.h>
-
-#include "xen_host.h"
-#include "xen_sr.h"
-#include "xen_vbd.h"
-#include "xen_vdi.h"
-#include "xen_console.h"
-#include "xen_vm.h"
-#include "xen_vm_metrics.h"
+#include <xen/api/xen_all.h>
 
 //#define PRINT_XML
 
index 16ba293da6b0ef06c1faa745aecdcd1fc59a58f7..188b585d0bc836ee53cb9d5c3d7327cea8b51ebd 100644 (file)
@@ -25,8 +25,7 @@
 
 #include <libxml/parser.h>
 #include <curl/curl.h>
-
-#include "xen_event.h"
+#include <xen/api/xen_event.h>
 
 //#define PRINT_XML
 
diff --git a/tools/libxen/test/test_hvm_bindings.c b/tools/libxen/test/test_hvm_bindings.c
deleted file mode 100644 (file)
index 8bc8e7c..0000000
+++ /dev/null
@@ -1,445 +0,0 @@
-/*
- * Copyright (c) 2006 XenSource, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- */
-
-#define _GNU_SOURCE
-#include <inttypes.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <libxml/parser.h>
-#include <curl/curl.h>
-
-#include "xen_host.h"
-#include "xen_sr.h"
-#include "xen_vbd.h"
-#include "xen_vdi.h"
-#include "xen_vm.h"
-
-
-static void usage()
-{
-    fprintf(stderr,
-"Usage:\n"
-"\n"
-"    test_bindings <url> <username> <password>\n"
-"\n"
-"where\n"
-"        <url>      is a fragment of the server's URL, e.g. localhost:8005/RPC2;\n"
-"        <username> is the username to use at the server; and\n"
-"        <password> is the password.\n");
-
-    exit(EXIT_FAILURE);
-}
-
-
-static char *url;
-
-
-typedef struct
-{
-    xen_result_func func;
-    void *handle;
-} xen_comms;
-
-
-static xen_vm create_new_vm(xen_session *session);
-static void print_vm_power_state(xen_session *session, xen_vm vm);
-
-
-static size_t
-write_func(void *ptr, size_t size, size_t nmemb, xen_comms *comms)
-{
-    size_t n = size * nmemb;
-    return comms->func(ptr, n, comms->handle) ? n : 0;
-}
-
-
-static int
-call_func(const void *data, size_t len, void *user_handle,
-          void *result_handle, xen_result_func result_func)
-{
-    (void)user_handle;
-
-    CURL *curl = curl_easy_init();
-    if (!curl) {
-        return -1;
-    }
-
-    xen_comms comms = {
-        .func = result_func,
-        .handle = result_handle
-    };
-
-    curl_easy_setopt(curl, CURLOPT_URL, url);
-    curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1);
-    curl_easy_setopt(curl, CURLOPT_MUTE, 1);
-    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &write_func);
-    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &comms);
-    curl_easy_setopt(curl, CURLOPT_POST, 1);
-    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
-    curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, len);
-
-    CURLcode result = curl_easy_perform(curl);
-
-    curl_easy_cleanup(curl);
-
-    return result;
-}
-
-
-static void print_error(xen_session *session)
-{
-    fprintf(stderr, "Error: %d", session->error_description_count);
-    for (int i = 0; i < session->error_description_count; i++)
-    {
-        fprintf(stderr, "%s ", session->error_description[i]);
-    }
-    fprintf(stderr, "\n");
-}
-
-
-int main(int argc, char **argv)
-{
-    if (argc != 4)
-    {
-        usage();
-    }
-
-    url = argv[1];
-    char *username = argv[2];
-    char *password = argv[3];
-
-    xmlInitParser();
-    xen_init();
-    curl_global_init(CURL_GLOBAL_ALL);
-
-#define CLEANUP                                 \
-    do {                                        \
-        xen_session_logout(session);            \
-        curl_global_cleanup();                  \
-        xen_fini();                             \
-        xmlCleanupParser();                     \
-    } while(0)                                  \
-
-    
-    xen_session *session =
-        xen_session_login_with_password(call_func, NULL, username, password);
-
-    xen_vm vm;
-    if (!xen_vm_get_by_uuid(session, &vm,
-                            "00000000-0000-0000-0000-000000000000"))
-    {
-        print_error(session);
-        CLEANUP;
-        return 1;
-    }
-
-    char *vm_uuid;
-    if (!xen_vm_get_uuid(session, &vm_uuid, vm))
-    {
-        print_error(session);
-        xen_vm_free(vm);
-        CLEANUP;
-        return 1;
-    }
-
-    char *vm_uuid_bytes;
-    if (!xen_uuid_string_to_bytes(vm_uuid, &vm_uuid_bytes))
-    {
-        fprintf(stderr, "xen_uuid_string_to_bytes failed.\n");
-        xen_uuid_free(vm_uuid);
-        xen_vm_free(vm);
-        CLEANUP;
-        return 1;
-    }
-
-    xen_vm_record *vm_record;
-    if (!xen_vm_get_record(session, &vm_record, vm))
-    {
-        print_error(session);
-        xen_uuid_bytes_free(vm_uuid_bytes);
-        xen_uuid_free(vm_uuid);
-        xen_vm_free(vm);
-        CLEANUP;
-        return 1;
-    }
-
-    xen_host host;
-    if (!xen_session_get_this_host(session, &host))
-    {
-        print_error(session);
-        xen_vm_record_free(vm_record);
-        xen_uuid_bytes_free(vm_uuid_bytes);
-        xen_uuid_free(vm_uuid);
-        xen_vm_free(vm);
-        CLEANUP;
-        return 1;
-    }
-
-    xen_string_string_map *versions;
-    if (!xen_host_get_software_version(session, &versions, host))
-    {
-        print_error(session);
-        xen_host_free(host);
-        xen_vm_record_free(vm_record);
-        xen_uuid_bytes_free(vm_uuid_bytes);
-        xen_uuid_free(vm_uuid);
-        xen_vm_free(vm);
-        CLEANUP;
-        return 1;
-    }
-
-    printf("%s.\n", vm_uuid);
-
-    fprintf(stderr, "In bytes, the VM UUID is ");
-    for (int i = 0; i < 15; i++)
-    {
-        fprintf(stderr, "%x, ", (unsigned int)vm_uuid_bytes[i]);
-    }
-    fprintf(stderr, "%x.\n", (unsigned int)vm_uuid_bytes[15]);
-
-    printf("%zd.\n", versions->size);
-
-    for (size_t i = 0; i < versions->size; i++)
-    {
-        printf("%s -> %s.\n", versions->contents[i].key,
-               versions->contents[i].val);
-    }
-
-    printf("%s.\n", vm_record->uuid);
-
-    printf("Resident on %s.\n", (char *)vm_record->resident_on->u.handle);
-
-    printf("%s.\n", xen_vm_power_state_to_string(vm_record->power_state));
-
-    for (size_t i = 0; i < vm_record->vcpus_utilisation->size; i++)
-    {
-        printf("%"PRId64" -> %lf.\n",
-               vm_record->vcpus_utilisation->contents[i].key,
-               vm_record->vcpus_utilisation->contents[i].val);
-    }
-
-    xen_uuid_bytes_free(vm_uuid_bytes);
-    xen_uuid_free(vm_uuid);
-    xen_vm_free(vm);
-
-    xen_vm_record_free(vm_record);
-
-    xen_host_free(host);
-    xen_string_string_map_free(versions);
-
-
-    xen_vm new_vm = create_new_vm(session);
-    if (!session->ok)
-    {
-        /* Error has been logged, just clean up. */
-        CLEANUP;
-        return 1;
-    }
-
-    print_vm_power_state(session, new_vm);
-    if (!session->ok)
-    {
-        /* Error has been logged, just clean up. */
-        xen_vm_free(new_vm);
-        CLEANUP;
-        return 1;
-    }
-
-    xen_vm_free(new_vm);
-    CLEANUP;
-
-    return 0;
-}
-
-
-/**
- * Creation of a new VM, using the Named Parameters idiom.  Allocate the
- * xen_vm_record here, but the sets through the library.  Either
- * allocation patterns can be used, as long as the allocation and free are
- * paired correctly.
- */
-static xen_vm create_new_vm(xen_session *session)
-{
-    xen_string_string_map *vcpus_params = xen_string_string_map_alloc(1);
-    xen_vm_record vm_record =
-        {
-            .name_label = "NewHVM",
-            .name_description = "New HVM Description",
-            .user_version = 1,
-            .is_a_template = false,
-            .memory_static_max = 256,
-            .memory_dynamic_max = 256,
-            .memory_dynamic_min = 128,
-            .memory_static_min = 128,
-            .vcpus_policy = "credit",
-            .vcpus_params = vcpus_params,
-            .vcpus_number = 2,
-            .actions_after_shutdown = XEN_ON_NORMAL_EXIT_DESTROY,
-            .actions_after_reboot = XEN_ON_NORMAL_EXIT_RESTART,
-            .actions_after_crash = XEN_ON_CRASH_BEHAVIOUR_PRESERVE,
-            .hvm_boot = "cda",
-        };
-
-
-    xen_vm vm;
-    xen_vm_create(session, &vm, &vm_record);
-
-    if (!session->ok)
-    {
-        fprintf(stderr, "VM creation failed.\n");
-        print_error(session);
-        return NULL;
-    }
-
-
-    /*
-     * Create a new disk for the new VM.
-     */
-    xen_sr_set *srs;
-    if (!xen_sr_get_by_name_label(session, &srs, "Local") ||
-        srs->size < 1)
-    {
-        fprintf(stderr, "SR lookup failed.\n");
-        print_error(session);
-        xen_vm_free(vm);
-        return NULL;
-    }
-
-    xen_sr_record_opt sr_record =
-        {
-            .u.handle = srs->contents[0]
-        };
-    xen_vdi_record vdi0_record =
-        {
-            .name_label = "MyRootFS",
-            .name_description = "MyRootFS description",
-            .sr = &sr_record,
-            .virtual_size = (1 << 21),  // 1GiB / 512 bytes/sector
-            .sector_size = 512,
-            .location = "file:/root/gentoo.amd64.hvm.img",
-            .type = XEN_VDI_TYPE_SYSTEM,
-            .sharable = false,
-            .read_only = false
-        };
-    
-    xen_vdi vdi0;
-    if (!xen_vdi_create(session, &vdi0, &vdi0_record))
-    {
-        fprintf(stderr, "VDI creation failed.\n");
-        print_error(session);
-
-        xen_sr_set_free(srs);
-        xen_vm_free(vm);
-        return NULL;
-    }
-
-
-    xen_vm_record_opt vm_record_opt =
-        {
-            .u.handle = vm
-        };
-    xen_vdi_record_opt vdi0_record_opt =
-        {
-            .u.handle = vdi0
-        };
-    xen_vbd_record vbd0_record =
-        {
-            .vm = &vm_record_opt,
-            .vdi = &vdi0_record_opt,
-            .device = "xvda1",
-            .mode = XEN_VBD_MODE_RW
-        };
-
-    xen_vbd vbd0;
-    if (!xen_vbd_create(session, &vbd0, &vbd0_record))
-    {
-        fprintf(stderr, "VBD creation failed.\n");
-        print_error(session);
-
-        xen_vdi_free(vdi0);
-        xen_sr_set_free(srs);
-        xen_vm_free(vm);
-        return NULL;
-    }
-
-    char *vm_uuid;
-    char *vdi0_uuid;
-    char *vbd0_uuid;
-
-    xen_vm_get_uuid(session,  &vm_uuid,   vm);
-    xen_vdi_get_uuid(session, &vdi0_uuid, vdi0);
-    xen_vbd_get_uuid(session, &vbd0_uuid, vbd0); 
-
-    if (!session->ok)
-    {
-        fprintf(stderr, "get_uuid call failed.\n");
-        print_error(session);
-
-        xen_uuid_free(vm_uuid);
-        xen_uuid_free(vdi0_uuid);
-        xen_uuid_free(vbd0_uuid);
-        xen_vbd_free(vbd0);
-        xen_vdi_free(vdi0);
-        xen_sr_set_free(srs);
-        xen_vm_free(vm);
-        return NULL;
-    }
-
-    fprintf(stderr,
-            "Created a new VM, with UUID %s, VDI UUID %s, and VBD UUID %s.\n",
-            vm_uuid, vdi0_uuid, vbd0_uuid);
-
-    xen_uuid_free(vm_uuid);
-    xen_uuid_free(vdi0_uuid);
-    xen_uuid_free(vbd0_uuid);
-    xen_vbd_free(vbd0);
-    xen_vdi_free(vdi0);
-    xen_sr_set_free(srs);
-
-    return vm;
-}
-
-
-/**
- * Print the power state for the given VM.
- */
-static void print_vm_power_state(xen_session *session, xen_vm vm)
-{
-    char *vm_uuid;
-    enum xen_vm_power_state power_state;
-
-    if (!xen_vm_get_uuid(session, &vm_uuid, vm))
-    {
-        print_error(session);
-        return;
-    }
-
-    if (!xen_vm_get_power_state(session, &power_state, vm))
-    {
-        xen_uuid_free(vm_uuid);
-        print_error(session);
-        return;
-    }
-
-    printf("VM %s power state is %s.\n", vm_uuid,
-           xen_vm_power_state_to_string(power_state));
-
-    xen_uuid_free(vm_uuid);
-}